@modernpoacher/deps 1.4.12 → 1.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/app.js +10 -7
- package/bin/common/index.js +14 -9
- package/bin/execute/app.js +21 -18
- package/bin/install/app.js +10 -7
- package/lib/common/git/index.js +2 -2
- package/lib/common/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/install/index.js +1 -1
- package/package.json +15 -15
- package/src/common/git/index.js +21 -7
- package/src/common/index.js +12 -0
- package/src/index.js +77 -86
- package/src/install/index.js +16 -17
- package/test/index.spec.js +288 -0
- package/test/install/index.spec.js +154 -0
package/bin/app.js
CHANGED
|
@@ -65,6 +65,7 @@ async function app () {
|
|
|
65
65
|
.option('-O, --save-optional [optionalDependencies]', 'Install `optionalDependencies`', false)
|
|
66
66
|
.option('-B, --save-bundle [bundleDependencies]', 'Install `bundleDependencies`', false)
|
|
67
67
|
.option('--registry [registry]', 'Installation registry')
|
|
68
|
+
.option('--force [force]', 'Force installation`', false)
|
|
68
69
|
.parse(argv)
|
|
69
70
|
|
|
70
71
|
/*
|
|
@@ -94,6 +95,7 @@ async function app () {
|
|
|
94
95
|
saveDev: D,
|
|
95
96
|
saveOptional: O,
|
|
96
97
|
saveBundle: B,
|
|
98
|
+
force,
|
|
97
99
|
registry
|
|
98
100
|
} = commander.opts()
|
|
99
101
|
|
|
@@ -102,14 +104,15 @@ async function app () {
|
|
|
102
104
|
saveDev: D,
|
|
103
105
|
saveOptional: O,
|
|
104
106
|
saveBundle: B,
|
|
105
|
-
...(registry ? { registry } : {})
|
|
107
|
+
...(registry ? { registry } : {}),
|
|
108
|
+
...(force ? { force } : {})
|
|
106
109
|
})
|
|
107
110
|
|
|
108
111
|
if ((P && D) || (!P && !D && !O && !B)) {
|
|
109
112
|
log('Prod')
|
|
110
113
|
|
|
111
114
|
try {
|
|
112
|
-
await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry)
|
|
115
|
+
await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, force)
|
|
113
116
|
} catch (e) {
|
|
114
117
|
handleError(e)
|
|
115
118
|
}
|
|
@@ -117,7 +120,7 @@ async function app () {
|
|
|
117
120
|
log('Dev')
|
|
118
121
|
|
|
119
122
|
try {
|
|
120
|
-
await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry)
|
|
123
|
+
await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, force)
|
|
121
124
|
} catch (e) {
|
|
122
125
|
handleError(e)
|
|
123
126
|
}
|
|
@@ -126,7 +129,7 @@ async function app () {
|
|
|
126
129
|
log('Prod')
|
|
127
130
|
|
|
128
131
|
try {
|
|
129
|
-
await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry)
|
|
132
|
+
await executeProd(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), registry, force)
|
|
130
133
|
} catch (e) {
|
|
131
134
|
handleError(e)
|
|
132
135
|
}
|
|
@@ -135,7 +138,7 @@ async function app () {
|
|
|
135
138
|
log('Dev')
|
|
136
139
|
|
|
137
140
|
try {
|
|
138
|
-
await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry)
|
|
141
|
+
await executeDev(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), registry, force)
|
|
139
142
|
} catch (e) {
|
|
140
143
|
handleError(e)
|
|
141
144
|
}
|
|
@@ -144,7 +147,7 @@ async function app () {
|
|
|
144
147
|
log('Optional')
|
|
145
148
|
|
|
146
149
|
try {
|
|
147
|
-
await executeOptional(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), registry)
|
|
150
|
+
await executeOptional(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), registry, force)
|
|
148
151
|
} catch (e) {
|
|
149
152
|
handleError(e)
|
|
150
153
|
}
|
|
@@ -153,7 +156,7 @@ async function app () {
|
|
|
153
156
|
log('Bundle')
|
|
154
157
|
|
|
155
158
|
try {
|
|
156
|
-
await executeBundle(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), registry)
|
|
159
|
+
await executeBundle(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), registry, force)
|
|
157
160
|
} catch (e) {
|
|
158
161
|
handleError(e)
|
|
159
162
|
}
|
package/bin/common/index.js
CHANGED
|
@@ -33,7 +33,10 @@ const {
|
|
|
33
33
|
const {
|
|
34
34
|
DIRECTORY,
|
|
35
35
|
REGISTRY,
|
|
36
|
-
NVM
|
|
36
|
+
NVM,
|
|
37
|
+
|
|
38
|
+
getRegistryParameter,
|
|
39
|
+
getForceParameter
|
|
37
40
|
} = require('@modernpoacher/deps/common')
|
|
38
41
|
|
|
39
42
|
const log = debug('@modernpoacher/deps')
|
|
@@ -58,20 +61,22 @@ rm -rf node_modules package-lock.json
|
|
|
58
61
|
exit 0
|
|
59
62
|
`)
|
|
60
63
|
|
|
61
|
-
const getNpmiCommands = (directory = DIRECTORY, registry = REGISTRY) => normalise(`
|
|
64
|
+
const getNpmiCommands = (directory = DIRECTORY, registry = REGISTRY, force = false) => normalise(`
|
|
62
65
|
cd "${directory}"
|
|
63
66
|
|
|
64
67
|
. "${NVM}"
|
|
65
68
|
|
|
66
|
-
npm i
|
|
69
|
+
${getRegistryParameter(registry, getForceParameter(force, 'npm i'))}
|
|
67
70
|
|
|
68
71
|
exit 0
|
|
69
72
|
`)
|
|
70
73
|
|
|
71
|
-
const getDepsCommands = (directory = DIRECTORY, registry = REGISTRY) => normalise(`
|
|
74
|
+
const getDepsCommands = (directory = DIRECTORY, registry = REGISTRY, force = false) => normalise(`
|
|
72
75
|
cd "${directory}"
|
|
73
76
|
|
|
74
|
-
|
|
77
|
+
. "${NVM}"
|
|
78
|
+
|
|
79
|
+
${getRegistryParameter(registry, getForceParameter(force, 'deps'))}
|
|
75
80
|
|
|
76
81
|
exit 0
|
|
77
82
|
`)
|
|
@@ -232,12 +237,12 @@ function rmrf (directory = DIRECTORY) {
|
|
|
232
237
|
)
|
|
233
238
|
}
|
|
234
239
|
|
|
235
|
-
function npmi (directory = DIRECTORY, registry = REGISTRY) {
|
|
240
|
+
function npmi (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
236
241
|
log('npmi')
|
|
237
242
|
|
|
238
243
|
return (
|
|
239
244
|
new Promise((resolve, reject) => {
|
|
240
|
-
const commands = getNpmiCommands(directory, registry)
|
|
245
|
+
const commands = getNpmiCommands(directory, registry, force)
|
|
241
246
|
|
|
242
247
|
const {
|
|
243
248
|
stdout,
|
|
@@ -250,12 +255,12 @@ function npmi (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
250
255
|
)
|
|
251
256
|
}
|
|
252
257
|
|
|
253
|
-
function deps (directory = DIRECTORY, registry = REGISTRY) {
|
|
258
|
+
function deps (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
254
259
|
log('deps')
|
|
255
260
|
|
|
256
261
|
return (
|
|
257
262
|
new Promise((resolve, reject) => {
|
|
258
|
-
const commands = getDepsCommands(directory, registry)
|
|
263
|
+
const commands = getDepsCommands(directory, registry, force)
|
|
259
264
|
|
|
260
265
|
const {
|
|
261
266
|
stdout,
|
package/bin/execute/app.js
CHANGED
|
@@ -112,15 +112,15 @@ async function mapRevParse (directory) {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
async function iterate ([directory, ...directories] = [], registry = REGISTRY) {
|
|
115
|
+
async function iterate ([directory, ...directories] = [], registry = REGISTRY, force = false) {
|
|
116
116
|
log('iterate')
|
|
117
117
|
|
|
118
|
-
if (directory) await execute(directory, registry)
|
|
118
|
+
if (directory) await execute(directory, registry, force)
|
|
119
119
|
|
|
120
|
-
if (directories.length) await iterate(directories, registry)
|
|
120
|
+
if (directories.length) await iterate(directories, registry, force)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
async function execute (directory = DIRECTORY, registry = REGISTRY) {
|
|
123
|
+
async function execute (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
124
124
|
log('execute')
|
|
125
125
|
|
|
126
126
|
try {
|
|
@@ -129,8 +129,8 @@ async function execute (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
129
129
|
await gitCheckout(directory, await catGitRefsRemotesOriginHead(directory))
|
|
130
130
|
await gitPull(directory)
|
|
131
131
|
await rmrf(directory)
|
|
132
|
-
await npmi(directory, registry)
|
|
133
|
-
await deps(directory, registry)
|
|
132
|
+
await npmi(directory, registry, force)
|
|
133
|
+
await deps(directory, registry, force)
|
|
134
134
|
await gitAdd(directory)
|
|
135
135
|
await gitCommit(directory)
|
|
136
136
|
await gitPush(directory)
|
|
@@ -139,7 +139,7 @@ async function execute (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
async function executeFrom (directory = DIRECTORY, registry = REGISTRY) {
|
|
142
|
+
async function executeFrom (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
143
143
|
log('executeFrom')
|
|
144
144
|
|
|
145
145
|
const path = resolve(directory)
|
|
@@ -147,7 +147,7 @@ async function executeFrom (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
147
147
|
try {
|
|
148
148
|
if (path === await gitRevParse(path)) {
|
|
149
149
|
return (
|
|
150
|
-
await execute(path, registry)
|
|
150
|
+
await execute(path, registry, force)
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
153
|
} catch (e) {
|
|
@@ -155,7 +155,7 @@ async function executeFrom (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
async function executeOnly (directory = DIRECTORY, registry = REGISTRY) {
|
|
158
|
+
async function executeOnly (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
159
159
|
log('executeOnly')
|
|
160
160
|
|
|
161
161
|
const path = resolve(directory)
|
|
@@ -163,7 +163,7 @@ async function executeOnly (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
163
163
|
try {
|
|
164
164
|
if (path === await gitRevParse(path)) {
|
|
165
165
|
return (
|
|
166
|
-
await execute(path, registry)
|
|
166
|
+
await execute(path, registry, force)
|
|
167
167
|
)
|
|
168
168
|
}
|
|
169
169
|
} catch (e) {
|
|
@@ -171,7 +171,7 @@ async function executeOnly (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
async function executePath (directory = DIRECTORY, registry = REGISTRY) {
|
|
174
|
+
async function executePath (directory = DIRECTORY, registry = REGISTRY, force = false) {
|
|
175
175
|
log('executePath')
|
|
176
176
|
|
|
177
177
|
const path = resolve(directory)
|
|
@@ -179,7 +179,7 @@ async function executePath (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
179
179
|
try {
|
|
180
180
|
if (path === await gitRevParse(path)) {
|
|
181
181
|
return (
|
|
182
|
-
await execute(path, registry)
|
|
182
|
+
await execute(path, registry, force)
|
|
183
183
|
)
|
|
184
184
|
}
|
|
185
185
|
} catch (e) {
|
|
@@ -193,7 +193,7 @@ async function executePath (directory = DIRECTORY, registry = REGISTRY) {
|
|
|
193
193
|
|
|
194
194
|
if (depsList.length) {
|
|
195
195
|
return (
|
|
196
|
-
await iterate(depsList, registry)
|
|
196
|
+
await iterate(depsList, registry, force)
|
|
197
197
|
)
|
|
198
198
|
}
|
|
199
199
|
}
|
|
@@ -215,27 +215,30 @@ async function app () {
|
|
|
215
215
|
.option('-f, --from [from]', 'Update from directory')
|
|
216
216
|
.option('-o, --only [only]', 'Update only directory')
|
|
217
217
|
.option('--registry [registry]', 'Installation registry')
|
|
218
|
+
.option('--force [force]', 'Force installation`', false)
|
|
218
219
|
.parse(argv)
|
|
219
220
|
|
|
220
221
|
const {
|
|
221
222
|
path: P,
|
|
222
223
|
from: F,
|
|
223
224
|
only: O,
|
|
224
|
-
registry
|
|
225
|
+
registry,
|
|
226
|
+
force
|
|
225
227
|
} = commander.opts()
|
|
226
228
|
|
|
227
229
|
log({
|
|
228
230
|
...(P ? { path: P } : {}),
|
|
229
231
|
...(F ? { from: F } : {}),
|
|
230
232
|
...(O ? { only: O } : {}),
|
|
231
|
-
...(registry ? { registry } : {})
|
|
233
|
+
...(registry ? { registry } : {}),
|
|
234
|
+
...(force ? { force } : {})
|
|
232
235
|
})
|
|
233
236
|
|
|
234
237
|
if (P || (!F && !O)) {
|
|
235
238
|
log('Path')
|
|
236
239
|
|
|
237
240
|
try {
|
|
238
|
-
await executePath(P, registry)
|
|
241
|
+
await executePath(P, registry, force)
|
|
239
242
|
} catch (e) {
|
|
240
243
|
handleError(e)
|
|
241
244
|
}
|
|
@@ -244,7 +247,7 @@ async function app () {
|
|
|
244
247
|
log('From')
|
|
245
248
|
|
|
246
249
|
try {
|
|
247
|
-
await executeFrom(P, registry)
|
|
250
|
+
await executeFrom(P, registry, force)
|
|
248
251
|
} catch (e) {
|
|
249
252
|
handleError(e)
|
|
250
253
|
}
|
|
@@ -253,7 +256,7 @@ async function app () {
|
|
|
253
256
|
log('Only')
|
|
254
257
|
|
|
255
258
|
try {
|
|
256
|
-
await executeOnly(P, registry)
|
|
259
|
+
await executeOnly(P, registry, force)
|
|
257
260
|
} catch (e) {
|
|
258
261
|
handleError(e)
|
|
259
262
|
}
|
package/bin/install/app.js
CHANGED
|
@@ -65,6 +65,7 @@ async function app () {
|
|
|
65
65
|
.option('-p, --peer [peerDependencies]', 'Install `peerDependencies`', false)
|
|
66
66
|
.option('-s, --save [save]', 'Install `peerDependencies`', false)
|
|
67
67
|
.option('--registry [registry]', 'Installation registry')
|
|
68
|
+
.option('--force [force]', 'Force installation`', false)
|
|
68
69
|
.parse(argv)
|
|
69
70
|
|
|
70
71
|
/*
|
|
@@ -96,7 +97,8 @@ async function app () {
|
|
|
96
97
|
bundle: B,
|
|
97
98
|
peer: p,
|
|
98
99
|
save,
|
|
99
|
-
registry
|
|
100
|
+
registry,
|
|
101
|
+
force
|
|
100
102
|
} = commander.opts()
|
|
101
103
|
|
|
102
104
|
log({
|
|
@@ -106,14 +108,15 @@ async function app () {
|
|
|
106
108
|
bundle: B,
|
|
107
109
|
peer: p,
|
|
108
110
|
save,
|
|
109
|
-
...(registry ? { registry } : {})
|
|
111
|
+
...(registry ? { registry } : {}),
|
|
112
|
+
...(force ? { force } : {})
|
|
110
113
|
})
|
|
111
114
|
|
|
112
115
|
if (P) {
|
|
113
116
|
log('Prod')
|
|
114
117
|
|
|
115
118
|
try {
|
|
116
|
-
await execute(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), save, registry)
|
|
119
|
+
await execute(DEPS_PATH, getProdDependencies(PACKAGE), getProdDependencies(CONFIGURATION), save, registry, force)
|
|
117
120
|
} catch (e) {
|
|
118
121
|
handleError(e)
|
|
119
122
|
}
|
|
@@ -122,7 +125,7 @@ async function app () {
|
|
|
122
125
|
log('Dev')
|
|
123
126
|
|
|
124
127
|
try {
|
|
125
|
-
await execute(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), save, registry)
|
|
128
|
+
await execute(DEPS_PATH, getDevDependencies(PACKAGE), getDevDependencies(CONFIGURATION), save, registry, force)
|
|
126
129
|
} catch (e) {
|
|
127
130
|
handleError(e)
|
|
128
131
|
}
|
|
@@ -131,7 +134,7 @@ async function app () {
|
|
|
131
134
|
log('Optional')
|
|
132
135
|
|
|
133
136
|
try {
|
|
134
|
-
await execute(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), save, registry)
|
|
137
|
+
await execute(DEPS_PATH, getOptionalDependencies(PACKAGE), getOptionalDependencies(CONFIGURATION), save, registry, force)
|
|
135
138
|
} catch (e) {
|
|
136
139
|
handleError(e)
|
|
137
140
|
}
|
|
@@ -140,7 +143,7 @@ async function app () {
|
|
|
140
143
|
log('Bundle')
|
|
141
144
|
|
|
142
145
|
try {
|
|
143
|
-
await execute(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), save, registry)
|
|
146
|
+
await execute(DEPS_PATH, getBundleDependencies(PACKAGE), getBundleDependencies(CONFIGURATION), save, registry, force)
|
|
144
147
|
} catch (e) {
|
|
145
148
|
handleError(e)
|
|
146
149
|
}
|
|
@@ -149,7 +152,7 @@ async function app () {
|
|
|
149
152
|
log('Peer')
|
|
150
153
|
|
|
151
154
|
try {
|
|
152
|
-
await execute(DEPS_PATH, getPeerDependencies(PACKAGE), getPeerDependencies(CONFIGURATION), save, registry)
|
|
155
|
+
await execute(DEPS_PATH, getPeerDependencies(PACKAGE), getPeerDependencies(CONFIGURATION), save, registry, force)
|
|
153
156
|
} catch (e) {
|
|
154
157
|
handleError(e)
|
|
155
158
|
}
|
package/lib/common/git/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.catGitRefsRemotesOriginHead=catGitRefsRemotesOriginHead;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.catGitRefsRemotesOriginHead=catGitRefsRemotesOriginHead;exports.gitAdd=gitAdd;exports.gitCheckout=gitCheckout;exports.gitCommit=gitCommit;exports.gitPull=gitPull;exports.gitPush=gitPush;exports.gitRevParse=gitRevParse;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const DIRECTORY='.';const BRANCH='master';const ADD='package.json package-lock.json';const COMMIT=(0,_os.platform)()==='win32'?'Updated `package.json` &/ `package-lock.json`':'Updated \\`package.json\\` &/ \\`package-lock.json\\`';const OPTIONS={maxBuffer:1024*2000};const log=(0,_debug.default)('@modernpoacher/deps');log(`\`git\` (${_os.platform}) is awake`);const trim=v=>v.split('\n').map(v=>v.trimEnd()).join('\n').trim();function use(key){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function use(v){log(trim(v));};}function out(key,directory){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function out(v){const s=v.trim();if(directory===s)return;return log(trim(s));};}function err(key,directory){const log=(0,_debug.default)(`@modernpoacher/deps:${key}`);return function err(v){const s=v.trim();if(directory===s||s.toLowerCase().startsWith('fatal: not a git repository'))return;return log(trim(s));};}const getErrorCode=({code=0}={})=>code;const getErrorMessage=({message=''}={})=>message;function getCatGitRefsRemotesOriginHeadCommand(directory=DIRECTORY){log('getCatGitRefsRemotesOriginHeadCommand');return`
|
|
2
2
|
DIR=$(echo "${directory}/.git/refs/remotes/origin/HEAD" | sed -e "s/\\//\\\\\\/g" -e "s/://" | cat 2> /dev/null)
|
|
3
3
|
[[ $DIR =~ "[-0-9a-zA-Z]*$" ]]
|
|
4
4
|
echo "$\{BASH_REMATCH[0]}"
|
|
5
|
-
`;}function isCommandError(e){log('isCommandError');return getErrorCode(e)===1&&getErrorMessage(e).toLowerCase().startsWith('command failed:');}function catGitRefsRemotesOriginHead(directory=DIRECTORY){log('catGitRefsRemotesOriginHead');return new Promise((resolve,reject)=>{const command=getCatGitRefsRemotesOriginHeadCommand(directory);
|
|
5
|
+
`;}function isCommandError(e){log('isCommandError');return getErrorCode(e)===1&&getErrorMessage(e).toLowerCase().startsWith('command failed:');}function catGitRefsRemotesOriginHead(directory=DIRECTORY){log('catGitRefsRemotesOriginHead');return new Promise((resolve,reject)=>{const command=getCatGitRefsRemotesOriginHeadCommand(directory);const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v='')=>!e?resolve(trim(v)):reject(e));stdout.on('data',out('cat-git-refs-remotes-origin-head',directory));stderr.on('data',err('cat-git-refs-remotes-origin-head',directory));});}function gitRevParse(directory=DIRECTORY){log('gitRevParse');return new Promise((resolve,reject)=>{const command='git rev-parse --show-toplevel';const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v='')=>!e?resolve(trim(v)):reject(e));stdout.on('data',out('git-rev-parse',directory));stderr.on('data',err('git-rev-parse',directory));});}function gitCheckout(directory=DIRECTORY,branch=BRANCH){log('gitCheckout');return new Promise((resolve,reject)=>{const command=`cd "${directory}" && git checkout ${branch}`;const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v)=>e?isCommandError(e)?resolve(v):reject(e):resolve(v));stdout.on('data',use('git-checkout'));stderr.on('data',use('git-checkout'));});}function gitPull(directory=DIRECTORY){log('gitPull');return new Promise((resolve,reject)=>{const command=`cd "${directory}" && git pull`;const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v)=>e?isCommandError(e)?resolve(v):reject(e):resolve(v));stdout.on('data',use('git-pull'));stderr.on('data',use('git-pull'));});}function gitPush(directory=DIRECTORY){log('gitPush');return new Promise((resolve,reject)=>{const command=`cd "${directory}" && git push`;const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v)=>e?isCommandError(e)?resolve(v):reject(e):resolve(v));stdout.on('data',use('git-push'));stderr.on('data',use('git-push'));});}function gitAdd(directory=DIRECTORY,add=ADD){log('gitAdd');return new Promise((resolve,reject)=>{const command=`cd "${directory}" && git add ${add}`;const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v)=>e?isCommandError(e)?resolve(v):reject(e):resolve(v));stdout.on('data',use('git-add'));stderr.on('data',use('git-add'));});}function gitCommit(directory=DIRECTORY,commit=COMMIT){log('gitCommit');return new Promise((resolve,reject)=>{const command=`cd "${directory}" && git commit -m "${commit}"`;const{stdout,stderr}=(0,_child_process.exec)(command,{...OPTIONS,cwd:directory},(e,v)=>e?isCommandError(e)?resolve(v):reject(e):resolve(v));stdout.on('data',use('git-commit'));stderr.on('data',use('git-commit'));});}
|
package/lib/common/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getCommands=exports.getBundleDependencies=exports.REGISTRY=exports.NVM=exports.DIRECTORY=void 0;exports.getDeps=getDeps;exports.getDepsExact=getDepsExact;exports.isExact=exports.getSaveProdParameter=exports.getSaveOptionalParameter=exports.getSaveExactParameter=exports.getSaveDevParameter=exports.getSaveBundleParameter=exports.getRegistryParameter=exports.getProdDependencies=exports.getPeerDependencies=exports.getOptionalDependencies=exports.getNoSaveParameter=exports.getForceParameter=exports.getDevDependencies=void 0;exports.normalise=normalise;exports.transform=transform;exports.transformDependency=void 0;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _path=require("path");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps');log(`\`common\` (${_os.platform}) is awake`);const{path:MODULE_PATH}=module;const DIRECTORY='.';exports.DIRECTORY=DIRECTORY;const REGISTRY='https://registry.npmjs.org';exports.REGISTRY=REGISTRY;const NVM=(0,_path.resolve)(MODULE_PATH,'../../nvm.sh');exports.NVM=NVM;const getSaveProdParameter=commands=>commands.concat(' --save-prod');exports.getSaveProdParameter=getSaveProdParameter;const getSaveDevParameter=commands=>commands.concat(' --save-dev');exports.getSaveDevParameter=getSaveDevParameter;const getSaveBundleParameter=commands=>commands.concat(' --save-bundle');exports.getSaveBundleParameter=getSaveBundleParameter;const getSaveOptionalParameter=commands=>commands.concat(' --save-optional');exports.getSaveOptionalParameter=getSaveOptionalParameter;const getRegistryParameter=(r,commands)=>r?commands.concat(` --registry ${r}`):commands;exports.getRegistryParameter=getRegistryParameter;const getForceParameter=(f,commands)=>f?commands.concat(' --force'):commands;exports.getForceParameter=getForceParameter;const getNoSaveParameter=(s,commands)=>s?commands:commands.concat(' --no-save');exports.getNoSaveParameter=getNoSaveParameter;const getSaveExactParameter=commands=>commands.concat(' --save-exact');exports.getSaveExactParameter=getSaveExactParameter;const getCommands=(directory=DIRECTORY,commands='npm i')=>`
|
|
2
2
|
export PATH=/usr/local/bin:$PATH &> /dev/null
|
|
3
3
|
|
|
4
4
|
cd "${directory}"
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.executeBundle=executeBundle;exports.executeDev=executeDev;exports.executeOptional=executeOptional;exports.executeProd=executeProd;exports.getInstallCommands=void 0;exports.getInstallSaveBundleCommands=getInstallSaveBundleCommands;exports.getInstallSaveBundleSaveExactCommands=getInstallSaveBundleSaveExactCommands;exports.getInstallSaveDevCommands=getInstallSaveDevCommands;exports.getInstallSaveDevSaveExactCommands=getInstallSaveDevSaveExactCommands;exports.getInstallSaveExactCommands=void 0;exports.getInstallSaveOptionalCommands=getInstallSaveOptionalCommands;exports.getInstallSaveOptionalSaveExactCommands=getInstallSaveOptionalSaveExactCommands;exports.getInstallSaveProdCommands=getInstallSaveProdCommands;exports.getInstallSaveProdSaveExactCommands=getInstallSaveProdSaveExactCommands;exports.installSaveBundle=installSaveBundle;exports.installSaveBundleSaveExact=installSaveBundleSaveExact;exports.installSaveDev=installSaveDev;exports.installSaveDevSaveExact=installSaveDevSaveExact;exports.installSaveOptional=installSaveOptional;exports.installSaveOptionalSaveExact=installSaveOptionalSaveExact;exports.installSaveProd=installSaveProd;exports.installSaveProdSaveExact=installSaveProdSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("./common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps');log(`\`deps\` (${_os.platform}) is awake`);const getInstallSaveExactCommands=(p,r,f)=>{log('getInstallSaveExactCommands');const commands=`npm i ${(0,_common.transform)(p)}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,r,f)=>{log('getInstallCommands');const commands=`npm i ${(0,_common.transform)(p)}`;return(0,_common.normalise)((0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands)));};exports.getInstallCommands=getInstallCommands;function getInstallSaveBundleSaveExactCommands(p,r,f){log('getInstallSaveBundleSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveBundleCommands(p,r,f){log('getInstallSaveBundleCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveBundleParameter)(commands));}function getInstallSaveOptionalSaveExactCommands(p,r,f){log('getInstallSaveOptionalSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveOptionalCommands(p,r,f){log('getInstallSaveOptionalCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveOptionalParameter)(commands));}function getInstallSaveDevSaveExactCommands(p,r,f){log('getInstallSaveDevSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveDevCommands(p,r,f){log('getInstallSaveDevCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveDevParameter)(commands));}function getInstallSaveProdSaveExactCommands(p,r,f){log('getInstallSaveProdSaveExactCommands');const commands=getInstallSaveExactCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function getInstallSaveProdCommands(p,r,f){log('getInstallSaveProdCommands');const commands=getInstallCommands(p,r,f);return(0,_common.normalise)((0,_common.getSaveProdParameter)(commands));}function installSaveBundleSaveExact(d,p,r,f){log('installSaveBundleSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveBundleSaveExactCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveBundle(d,p,r,f){log('installSaveBundle');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveBundleCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveOptionalSaveExact(d,p,r,f){log('installSaveOptionalSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveOptionalSaveExactCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveOptional(d,p,r,f){log('installSaveOptional');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveOptionalCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveDevSaveExact(d,p,r,f){log('installSaveDevSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveDevSaveExactCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveDev(d,p,r,f){log('installSaveDev');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveDevCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveProdSaveExact(d,p,r,f){log('installSaveProdSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveProdSaveExactCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function installSaveProd(d,p,r,f){log('installSaveProd');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveProdCommands(p,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}async function executeBundle(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeBundle');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveBundleSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveBundle(directory,deps,registry,force);}async function executeOptional(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeOptional');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveOptionalSaveExact(directory,depsExact,registry);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveOptional(directory,deps,registry);}async function executeDev(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeDev');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveDevSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveDev(directory,deps,registry,force);}async function executeProd(directory=_common.DIRECTORY,packages={},configuration={},registry=_common.REGISTRY,force=false){log('executeProd');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveProdSaveExact(directory,depsExact,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await installSaveProd(directory,deps,registry,force);}
|
package/lib/install/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.execute=execute;exports.getInstallSaveExactCommands=exports.getInstallCommands=void 0;exports.install=install;exports.installSaveExact=installSaveExact;var _debug=_interopRequireDefault(require("debug"));var _os=require("os");var _child_process=require("child_process");var _common=require("../common");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}const log=(0,_debug.default)('@modernpoacher/deps:install');log(`\`install\` (${_os.platform}) is awake`);const getInstallSaveExactCommands=(p,s,r,f)=>{log('getInstallSaveExactCommands');const commands=`npm i ${(0,_common.transform)(p)}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,(0,_common.getSaveExactParameter)(commands)))));};exports.getInstallSaveExactCommands=getInstallSaveExactCommands;const getInstallCommands=(p,s,r,f)=>{log('getInstallCommands');const commands=`npm i ${(0,_common.transform)(p)}`;return(0,_common.normalise)((0,_common.getNoSaveParameter)(s,(0,_common.getRegistryParameter)(r,(0,_common.getForceParameter)(f,commands))));};exports.getInstallCommands=getInstallCommands;function installSaveExact(d,p,s,r,f){log('installSaveExact');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallSaveExactCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}function install(d,p,s,r,f){log('install');return new Promise((resolve,reject)=>{const commands=(0,_common.getCommands)(d,getInstallCommands(p,s,r,f));(0,_child_process.spawn)('/bin/bash',['-c',commands],{shell:true,stdio:'inherit'},e=>!e?resolve():reject(e)).on('close',resolve).on('error',reject);});}async function execute(directory=_common.DIRECTORY,packages={},configuration={},save=false,registry=_common.REGISTRY,force=false){log('execute');const depsExact=(0,_common.getDepsExact)(packages,configuration);if(depsExact.length)await installSaveExact(directory,depsExact,save,registry,force);const deps=(0,_common.getDeps)(packages);if(deps.length)await install(directory,deps,save,registry,force);}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modernpoacher/deps",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.16",
|
|
4
4
|
"description": "Update NPM package dependencies from the command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deps",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"author": "Jonathan Perry for Modern Poacher Limited <modernpoacher@modernpoacher.com>",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"engines": {
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=16.13.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -50,30 +50,30 @@
|
|
|
50
50
|
"deps-head": "bin/head.sh"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"commander": "^8.
|
|
53
|
+
"commander": "^8.3.0",
|
|
54
54
|
"debug": "^4.3.2",
|
|
55
55
|
"glob-all": "^3.2.1",
|
|
56
56
|
"module-alias": "^2.2.2",
|
|
57
|
-
"supports-color": "^9.0
|
|
57
|
+
"supports-color": "^9.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@babel/cli": "^7.
|
|
61
|
-
"@babel/core": "^7.
|
|
62
|
-
"@babel/eslint-parser": "^7.
|
|
63
|
-
"@babel/preset-env": "^7.
|
|
64
|
-
"@babel/register": "^7.
|
|
60
|
+
"@babel/cli": "^7.16.0",
|
|
61
|
+
"@babel/core": "^7.16.0",
|
|
62
|
+
"@babel/eslint-parser": "^7.16.3",
|
|
63
|
+
"@babel/preset-env": "^7.16.4",
|
|
64
|
+
"@babel/register": "^7.16.0",
|
|
65
65
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
66
66
|
"chai": "^4.3.4",
|
|
67
|
-
"core-js": "^3.
|
|
67
|
+
"core-js": "^3.19.1",
|
|
68
68
|
"cross-env": "^7.0.3",
|
|
69
|
-
"eslint": "
|
|
69
|
+
"eslint": "7.32.0",
|
|
70
70
|
"eslint-config-standard": "^16.0.3",
|
|
71
71
|
"eslint-import-resolver-babel-module": "^5.3.1",
|
|
72
|
-
"eslint-plugin-import": "^2.
|
|
72
|
+
"eslint-plugin-import": "^2.25.3",
|
|
73
73
|
"eslint-plugin-node": "^11.1.0",
|
|
74
|
-
"eslint-plugin-promise": "^5.1.
|
|
75
|
-
"husky": "^7.0.
|
|
76
|
-
"mocha": "^9.1.
|
|
74
|
+
"eslint-plugin-promise": "^5.1.1",
|
|
75
|
+
"husky": "^7.0.4",
|
|
76
|
+
"mocha": "^9.1.3",
|
|
77
77
|
"rimraf": "^3.0.2"
|
|
78
78
|
},
|
|
79
79
|
"_moduleAliases": {
|
package/src/common/git/index.js
CHANGED
|
@@ -139,7 +139,9 @@ export function catGitRefsRemotesOriginHead (directory = DIRECTORY) {
|
|
|
139
139
|
new Promise((resolve, reject) => {
|
|
140
140
|
const command = getCatGitRefsRemotesOriginHeadCommand(directory)
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
/**
|
|
143
|
+
* log(command)
|
|
144
|
+
*/
|
|
143
145
|
|
|
144
146
|
const {
|
|
145
147
|
stdout,
|
|
@@ -168,7 +170,9 @@ export function gitRevParse (directory = DIRECTORY) {
|
|
|
168
170
|
new Promise((resolve, reject) => {
|
|
169
171
|
const command = 'git rev-parse --show-toplevel'
|
|
170
172
|
|
|
171
|
-
|
|
173
|
+
/**
|
|
174
|
+
* log(command)
|
|
175
|
+
*/
|
|
172
176
|
|
|
173
177
|
const {
|
|
174
178
|
stdout,
|
|
@@ -197,7 +201,9 @@ export function gitCheckout (directory = DIRECTORY, branch = BRANCH) {
|
|
|
197
201
|
new Promise((resolve, reject) => {
|
|
198
202
|
const command = `cd "${directory}" && git checkout ${branch}`
|
|
199
203
|
|
|
200
|
-
|
|
204
|
+
/**
|
|
205
|
+
* log(command)
|
|
206
|
+
*/
|
|
201
207
|
|
|
202
208
|
const {
|
|
203
209
|
stdout,
|
|
@@ -226,7 +232,9 @@ export function gitPull (directory = DIRECTORY) {
|
|
|
226
232
|
new Promise((resolve, reject) => {
|
|
227
233
|
const command = `cd "${directory}" && git pull`
|
|
228
234
|
|
|
229
|
-
|
|
235
|
+
/**
|
|
236
|
+
* log(command)
|
|
237
|
+
*/
|
|
230
238
|
|
|
231
239
|
const {
|
|
232
240
|
stdout,
|
|
@@ -255,7 +263,9 @@ export function gitPush (directory = DIRECTORY) {
|
|
|
255
263
|
new Promise((resolve, reject) => {
|
|
256
264
|
const command = `cd "${directory}" && git push`
|
|
257
265
|
|
|
258
|
-
|
|
266
|
+
/**
|
|
267
|
+
* log(command)
|
|
268
|
+
*/
|
|
259
269
|
|
|
260
270
|
const {
|
|
261
271
|
stdout,
|
|
@@ -285,7 +295,9 @@ export function gitAdd (directory = DIRECTORY, add = ADD) {
|
|
|
285
295
|
new Promise((resolve, reject) => {
|
|
286
296
|
const command = `cd "${directory}" && git add ${add}`
|
|
287
297
|
|
|
288
|
-
|
|
298
|
+
/**
|
|
299
|
+
* log(command)
|
|
300
|
+
*/
|
|
289
301
|
|
|
290
302
|
const {
|
|
291
303
|
stdout,
|
|
@@ -315,7 +327,9 @@ export function gitCommit (directory = DIRECTORY, commit = COMMIT) {
|
|
|
315
327
|
new Promise((resolve, reject) => {
|
|
316
328
|
const command = `cd "${directory}" && git commit -m "${commit}"`
|
|
317
329
|
|
|
318
|
-
|
|
330
|
+
/**
|
|
331
|
+
* log(command)
|
|
332
|
+
*/
|
|
319
333
|
|
|
320
334
|
const {
|
|
321
335
|
stdout,
|
package/src/common/index.js
CHANGED
|
@@ -78,6 +78,18 @@ export const getSaveOptionalParameter = (commands) => commands.concat(' --save-o
|
|
|
78
78
|
*/
|
|
79
79
|
export const getRegistryParameter = (r, commands) => r ? commands.concat(` --registry ${r}`) : commands
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* @function getForceParameter
|
|
83
|
+
*
|
|
84
|
+
* Get the "force" parameter and argument
|
|
85
|
+
*
|
|
86
|
+
* @param {String} force
|
|
87
|
+
* @param {String} current commands string
|
|
88
|
+
*
|
|
89
|
+
* @return {String}
|
|
90
|
+
*/
|
|
91
|
+
export const getForceParameter = (f, commands) => f ? commands.concat(' --force') : commands
|
|
92
|
+
|
|
81
93
|
/**
|
|
82
94
|
* @function getNoSaveParameter
|
|
83
95
|
*
|