@modernpoacher/deps 2.0.1 → 2.0.2
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/execute/app.mjs +34 -34
- package/package.json +1 -1
package/bin/execute/app.mjs
CHANGED
|
@@ -75,24 +75,28 @@ function handleCommandError (e) {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
async function getIgnoreFromConfiguration (
|
|
78
|
+
async function getIgnoreFromConfiguration (directory) {
|
|
79
79
|
log('getIgnoreFromConfiguration')
|
|
80
80
|
|
|
81
|
-
const CONFIGURATION =
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
const CONFIGURATION = (
|
|
82
|
+
await hasConfiguration(directory)
|
|
83
|
+
? await getConfiguration(directory)
|
|
84
|
+
: {}
|
|
85
|
+
)
|
|
84
86
|
|
|
85
87
|
return (
|
|
86
88
|
getIgnore(CONFIGURATION)
|
|
87
89
|
)
|
|
88
90
|
}
|
|
89
91
|
|
|
90
|
-
async function getAuthorFromConfiguration (
|
|
92
|
+
async function getAuthorFromConfiguration (directory) {
|
|
91
93
|
log('getAuthorFromConfiguration')
|
|
92
94
|
|
|
93
|
-
const CONFIGURATION =
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
const CONFIGURATION = (
|
|
96
|
+
await hasConfiguration(directory)
|
|
97
|
+
? await getConfiguration(directory)
|
|
98
|
+
: {}
|
|
99
|
+
)
|
|
96
100
|
|
|
97
101
|
return (
|
|
98
102
|
getAuthor(CONFIGURATION)
|
|
@@ -108,7 +112,11 @@ function getPathList (directory) {
|
|
|
108
112
|
|
|
109
113
|
return (
|
|
110
114
|
new Promise((resolve, reject) => {
|
|
111
|
-
glob(`${directory}/*/`, (error, array) =>
|
|
115
|
+
glob(`${directory}/*/`, (error, array) => {
|
|
116
|
+
(!error)
|
|
117
|
+
? resolve(array)
|
|
118
|
+
: reject(error)
|
|
119
|
+
})
|
|
112
120
|
})
|
|
113
121
|
)
|
|
114
122
|
}
|
|
@@ -146,15 +154,13 @@ async function iterate ([directory, ...directories] = [], registry, force, messa
|
|
|
146
154
|
log('iterate')
|
|
147
155
|
|
|
148
156
|
if (directory) {
|
|
149
|
-
const
|
|
157
|
+
const D = resolve(directory)
|
|
150
158
|
|
|
151
159
|
try {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (path === await gitRevParse(path)) {
|
|
155
|
-
const ignore = await getIgnoreFromConfiguration(path)
|
|
160
|
+
if (D === await gitRevParse(D)) {
|
|
161
|
+
const ignore = await getIgnoreFromConfiguration(D)
|
|
156
162
|
if (!ignore) {
|
|
157
|
-
await execute(
|
|
163
|
+
await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
|
|
158
164
|
}
|
|
159
165
|
}
|
|
160
166
|
} catch (e) {
|
|
@@ -190,16 +196,14 @@ async function execute (directory = DIRECTORY, registry = REGISTRY, force = fals
|
|
|
190
196
|
async function executeFrom (directory, registry, force, message, author) {
|
|
191
197
|
log('executeFrom')
|
|
192
198
|
|
|
193
|
-
const
|
|
199
|
+
const D = resolve(directory)
|
|
194
200
|
|
|
195
201
|
try {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
if (path === await gitRevParse(path)) {
|
|
199
|
-
const ignore = await getIgnoreFromConfiguration(path)
|
|
202
|
+
if (D === await gitRevParse(D)) {
|
|
203
|
+
const ignore = await getIgnoreFromConfiguration(D)
|
|
200
204
|
if (!ignore) {
|
|
201
205
|
return (
|
|
202
|
-
await execute(
|
|
206
|
+
await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
|
|
203
207
|
)
|
|
204
208
|
}
|
|
205
209
|
}
|
|
@@ -211,16 +215,14 @@ async function executeFrom (directory, registry, force, message, author) {
|
|
|
211
215
|
async function executeOnly (directory, registry, force, message, author) {
|
|
212
216
|
log('executeOnly')
|
|
213
217
|
|
|
214
|
-
const
|
|
218
|
+
const D = resolve(directory)
|
|
215
219
|
|
|
216
220
|
try {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
if (path === await gitRevParse(path)) {
|
|
220
|
-
const ignore = await getIgnoreFromConfiguration(path)
|
|
221
|
+
if (D === await gitRevParse(D)) {
|
|
222
|
+
const ignore = await getIgnoreFromConfiguration(D)
|
|
221
223
|
if (!ignore) {
|
|
222
224
|
return (
|
|
223
|
-
await execute(
|
|
225
|
+
await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
|
|
224
226
|
)
|
|
225
227
|
}
|
|
226
228
|
}
|
|
@@ -232,16 +234,14 @@ async function executeOnly (directory, registry, force, message, author) {
|
|
|
232
234
|
async function executePath (directory, registry, force, message, author) {
|
|
233
235
|
log('executePath')
|
|
234
236
|
|
|
235
|
-
const
|
|
237
|
+
const D = resolve(directory)
|
|
236
238
|
|
|
237
239
|
try {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
if (path === await gitRevParse(path)) {
|
|
241
|
-
const ignore = await getIgnoreFromConfiguration(path)
|
|
240
|
+
if (D === await gitRevParse(D)) {
|
|
241
|
+
const ignore = await getIgnoreFromConfiguration(D)
|
|
242
242
|
if (!ignore) {
|
|
243
243
|
return (
|
|
244
|
-
await execute(
|
|
244
|
+
await execute(D, registry, force, message, author || await getAuthorFromConfiguration(D))
|
|
245
245
|
)
|
|
246
246
|
}
|
|
247
247
|
}
|
|
@@ -249,7 +249,7 @@ async function executePath (directory, registry, force, message, author) {
|
|
|
249
249
|
handleCommandError(e)
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
const pathList = await getPathList(
|
|
252
|
+
const pathList = await getPathList(D)
|
|
253
253
|
|
|
254
254
|
if (pathList.length) {
|
|
255
255
|
const depsList = await getDepsList(pathList)
|