Skip to content

Commit 03086c7

Browse files
committed
replace fs mkdirSync with shelljs
1 parent 0c6ac7c commit 03086c7

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"read-yaml": "^1.1.0",
5656
"request": "^2.87.0",
5757
"request-promise-native": "^1.0.4",
58+
"shelljs": "^0.8.3",
5859
"tempfile": "^2.0.0",
5960
"underscore": "^1.9.1",
6061
"xdg-basedir": "^3.0.0",

src/include/file-config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fs = require('fs');
2+
const shell = require('shelljs');
23
const path = require('path');
34
const os = require("os");
45
const xdgBaseDir = require('xdg-basedir');
@@ -90,9 +91,11 @@ class fileConfig extends config {
9091
fs.renameSync(this.oldGlobalDir, this.globalDir);
9192
}
9293

93-
if (!fs.existsSync(this.globalDir)) fs.mkdirSync(this.globalDir, '0750', true);
94-
if (!fs.existsSync(this.frameDir)) fs.mkdirSync(this.frameDir, '0750', true);
95-
if (!fs.existsSync(this.cacheDir)) fs.mkdirSync(this.cacheDir, '0750', true);
94+
95+
96+
if (!fs.existsSync(this.globalDir)) shell.mkdir('-p', this.globalDir);
97+
if (!fs.existsSync(this.frameDir)) shell.mkdir('-p', this.frameDir);
98+
if (!fs.existsSync(this.cacheDir)) shell.mkdir('-p', this.cacheDir);
9699
if (!fs.existsSync(this.global)) fs.appendFileSync(this.global, '');
97100
}
98101

yarn.lock

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ glob@^5.0.15:
949949
once "^1.3.0"
950950
path-is-absolute "^1.0.0"
951951

952-
glob@^7.1.2:
952+
glob@^7.0.0, glob@^7.1.2:
953953
version "7.1.3"
954954
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
955955
dependencies:
@@ -1150,6 +1150,11 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3:
11501150
version "2.0.3"
11511151
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
11521152

1153+
interpret@^1.0.0:
1154+
version "1.2.0"
1155+
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296"
1156+
integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==
1157+
11531158
11541159
version "4.0.0"
11551160
resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-4.0.0.tgz#ef10ee2ffb6f78af34c93194bbdc36c35f7d8a9d"
@@ -1757,7 +1762,7 @@ path-is-absolute@^1.0.0:
17571762
version "1.0.1"
17581763
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
17591764

1760-
path-parse@^1.0.5:
1765+
path-parse@^1.0.5, path-parse@^1.0.6:
17611766
version "1.0.6"
17621767
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
17631768

@@ -1948,6 +1953,13 @@ readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.1.4, readable
19481953
string_decoder "~1.1.1"
19491954
util-deprecate "~1.0.1"
19501955

1956+
rechoir@^0.6.2:
1957+
version "0.6.2"
1958+
resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384"
1959+
integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=
1960+
dependencies:
1961+
resolve "^1.1.6"
1962+
19511963
regenerator-runtime@^0.11.0:
19521964
version "0.11.1"
19531965
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
@@ -2116,6 +2128,13 @@ [email protected]:
21162128
dependencies:
21172129
path-parse "^1.0.5"
21182130

2131+
resolve@^1.1.6:
2132+
version "1.10.0"
2133+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba"
2134+
integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==
2135+
dependencies:
2136+
path-parse "^1.0.6"
2137+
21192138
restore-cursor@^2.0.0:
21202139
version "2.0.0"
21212140
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
@@ -2187,6 +2206,15 @@ set-value@^2.0.0:
21872206
is-plain-object "^2.0.3"
21882207
split-string "^3.0.1"
21892208

2209+
shelljs@^0.8.3:
2210+
version "0.8.3"
2211+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
2212+
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
2213+
dependencies:
2214+
glob "^7.0.0"
2215+
interpret "^1.0.0"
2216+
rechoir "^0.6.2"
2217+
21902218
signal-exit@^3.0.2:
21912219
version "3.0.2"
21922220
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"

0 commit comments

Comments
 (0)