Skip to content

Commit eab5e76

Browse files
author
Rafael Grigorian
committed
- Fixed #12
- Fixed #11 - Fixed #7 - Fixed #6
1 parent 6ff1d57 commit eab5e76

File tree

6 files changed

+457
-928
lines changed

6 files changed

+457
-928
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10.19.0

package.json

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,26 @@
88
"license": "MIT",
99
"private": true,
1010
"scripts": {
11-
"package": "pkg --out-path dist --config package.json src/index.js"
11+
"package": "pkg --out-path dist --config package.json src/index.js",
12+
"clean": "rm -rf ./dist"
1213
},
1314
"resolutions": {
14-
"**/**/set-value": "^2.0.1"
15+
"**/**/minimist": "^1.2.5"
1516
},
1617
"dependencies": {
17-
"axios": "^0.18.1",
18-
"chalk": "^2.4.2",
19-
"minimist": "^1.2.0",
20-
"shelljs": "^0.8.3",
21-
"strip-ansi": "^5.0.0",
18+
"axios": "^0.19.2",
19+
"chalk": "^4.1.0",
20+
"minimist": "^1.2.5",
21+
"strip-ansi": "^6.0.0",
2222
"targz": "^1.0.1"
2323
},
2424
"devDependencies": {
25-
"pkg": "^4.3.5"
25+
"pkg": "^4.4.9"
26+
},
27+
"pkg": {
28+
"targets": [
29+
"node10-macos-x64",
30+
"node10-linux-x64"
31+
]
2632
}
2733
}

src/context.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const fs = require ("fs")
44
const path = require ("path")
55
const strip = require ("strip-ansi")
66
const targz = require ("targz")
7-
const shell = require ("shelljs")
87
const { load } = require ("./account")
98

109
const VERSION = "2.0.1"
@@ -48,10 +47,14 @@ class Context {
4847
if ( this.quiet ) return
4948
if ( !this.unicode ) {
5049
console.error ( `${chalk.red ("Error")}:`, ...arguments )
50+
console.error ("")
51+
require ("./commands/help") ( this )
5152
}
5253
else {
5354
let stripped = Object.values ( arguments ).map ( i => strip ( i ) )
5455
console.error ( "Error:", ...stripped )
56+
console.error ("")
57+
require ("./commands/help") ( this )
5558
}
5659
}
5760

@@ -75,7 +78,7 @@ class Context {
7578

7679
mkdir ( destination ) {
7780
try {
78-
shell.mkdir ( "-p", destination )
81+
fs.mkdirSync ( destination, { recursive: true } )
7982
}
8083
catch ( error ) {
8184
throw "permission issue with download path"

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ parse ( process.argv.slice ( 2 ) )
3030
})
3131
.catch ( payload => {
3232
const { context, error } = payload
33-
context.error ( error || "unknown command, use -h for help" )
33+
context.error ( error || "unknown command, see help below:" )
3434
})

src/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function parse ( data ) {
213213
}
214214
else if ( !args.help && !args.version ) {
215215
return Promise.reject ({
216-
error: "specify command, use -h for help",
216+
error: "specify command, see help below:",
217217
context
218218
})
219219
}

0 commit comments

Comments
 (0)