Skip to content

Commit

Permalink
- Fixed #12
Browse files Browse the repository at this point in the history
- Fixed #11
- Fixed #7
- Fixed #6
  • Loading branch information
Rafael Grigorian committed Jul 6, 2020
1 parent 6ff1d57 commit eab5e76
Show file tree
Hide file tree
Showing 6 changed files with 457 additions and 928 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.19.0
22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,26 @@
"license": "MIT",
"private": true,
"scripts": {
"package": "pkg --out-path dist --config package.json src/index.js"
"package": "pkg --out-path dist --config package.json src/index.js",
"clean": "rm -rf ./dist"
},
"resolutions": {
"**/**/set-value": "^2.0.1"
"**/**/minimist": "^1.2.5"
},
"dependencies": {
"axios": "^0.18.1",
"chalk": "^2.4.2",
"minimist": "^1.2.0",
"shelljs": "^0.8.3",
"strip-ansi": "^5.0.0",
"axios": "^0.19.2",
"chalk": "^4.1.0",
"minimist": "^1.2.5",
"strip-ansi": "^6.0.0",
"targz": "^1.0.1"
},
"devDependencies": {
"pkg": "^4.3.5"
"pkg": "^4.4.9"
},
"pkg": {
"targets": [
"node10-macos-x64",
"node10-linux-x64"
]
}
}
7 changes: 5 additions & 2 deletions src/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const fs = require ("fs")
const path = require ("path")
const strip = require ("strip-ansi")
const targz = require ("targz")
const shell = require ("shelljs")
const { load } = require ("./account")

const VERSION = "2.0.1"
Expand Down Expand Up @@ -48,10 +47,14 @@ class Context {
if ( this.quiet ) return
if ( !this.unicode ) {
console.error ( `${chalk.red ("Error")}:`, ...arguments )
console.error ("")
require ("./commands/help") ( this )
}
else {
let stripped = Object.values ( arguments ).map ( i => strip ( i ) )
console.error ( "Error:", ...stripped )
console.error ("")
require ("./commands/help") ( this )
}
}

Expand All @@ -75,7 +78,7 @@ class Context {

mkdir ( destination ) {
try {
shell.mkdir ( "-p", destination )
fs.mkdirSync ( destination, { recursive: true } )
}
catch ( error ) {
throw "permission issue with download path"
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ parse ( process.argv.slice ( 2 ) )
})
.catch ( payload => {
const { context, error } = payload
context.error ( error || "unknown command, use -h for help" )
context.error ( error || "unknown command, see help below:" )
})
2 changes: 1 addition & 1 deletion src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function parse ( data ) {
}
else if ( !args.help && !args.version ) {
return Promise.reject ({
error: "specify command, use -h for help",
error: "specify command, see help below:",
context
})
}
Expand Down
Loading

0 comments on commit eab5e76

Please sign in to comment.