Skip to content

Commit

Permalink
Handle paths with tildes
Browse files Browse the repository at this point in the history
  • Loading branch information
TehShrike committed Jul 23, 2020
1 parent e62e382 commit acb668d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const { join: joinPath } = require(`path`)
const { get } = require(`httpie`)
const makeDir = require(`make-dir`)
const filenamify = require(`filenamify`)
const untildify = require(`untildify`)

const catchify = promise => promise.then(result => [ null, result ]).catch(err => [ err, null ])

Expand Down Expand Up @@ -34,10 +35,12 @@ const stepper = async(increment, fn) => {
}
}

const main = async({ user, password, path, all, apiKey, countPerRequest }) => {
const main = async({ user, password, path: potentiallyTildifiedPath, all, apiKey, countPerRequest }) => {
const headers = buildHeaders({ user, password })
const count = parseInt(countPerRequest, 10)

const path = untildify(potentiallyTildifiedPath)

await makeDir(path)

let synced = 0
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"httpie": "^1.1.2",
"make-dir": "^3.1.0",
"mri": "^1.1.6",
"pify": "^5.0.0"
"pify": "^5.0.0",
"untildify": "^4.0.0"
}
}

0 comments on commit acb668d

Please sign in to comment.