Skip to content

Commit

Permalink
Merge pull request #174 from simonh1000/sh/bugfix-read
Browse files Browse the repository at this point in the history
Bugfix read
  • Loading branch information
simonh1000 authored Feb 28, 2024
2 parents 846cdab + 2772283 commit 34495af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ npm test

```sh
npm version patch
git commit -m 'bump'
npm publish
git push origin vx.y.z
```
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ftp-deploy",
"version": "2.4.6",
"version": "2.4.7",
"author": "Simon Hampton",
"description": "Ftp a folder from your local disk to an ftp destination",
"main": "src/ftp-deploy",
Expand All @@ -12,7 +12,7 @@
"minimatch": "9.0.0",
"promise-ftp": "^1.3.5",
"read": "^2.1.0",
"ssh2-sftp-client": "^7.2.1",
"ssh2-sftp-client": "^7.2.3",
"upath": "^2.0.1"
},
"devDependencies": {
Expand Down
10 changes: 4 additions & 6 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const path = require("upath");
const util = require("util");

const read = require("read");
const readP = util.promisify(read);

const { minimatch } = require("minimatch");

Expand Down Expand Up @@ -35,7 +34,7 @@ function getPassword(config) {
default: "",
silent: true,
};
return readP(options).then((res) => {
return read(options).then((res) => {
let config2 = Object.assign(config, { password: res });
return config2;
});
Expand Down Expand Up @@ -157,10 +156,9 @@ function mapSeries(array, mapper) {
// Chain a new Promise to the result
result = result.then(() => {
// Apply the mapper function to the current item
return mapper(item, index, array)
.then(res => {
output.push(res);
});
return mapper(item, index, array).then((res) => {
output.push(res);
});
});
});

Expand Down

0 comments on commit 34495af

Please sign in to comment.