@naturalcycles/nodejs-lib 15.19.0 → 15.20.1

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.
@@ -241,18 +241,30 @@ class Exec2 {
241
241
  logStart(cmd, opt) {
242
242
  if (!opt.logStart)
243
243
  return;
244
- console.log([
245
- dimGrey(...Object.entries(opt.env || {}).map(([k, v]) => [k, v].join('='))),
246
- white(opt.name || _substringAfterLast(cmd, '/')),
247
- ...((!opt.name && opt.args) || []),
248
- ]
249
- .filter(Boolean)
250
- .join(' '));
244
+ const envString = Object.entries(opt.env || {})
245
+ .map(([k, v]) => [k, v].join('='))
246
+ .join(' ');
247
+ if (opt.name) {
248
+ console.log([' ', dimGrey(envString), white(opt.name), dimGrey('started...')]
249
+ .filter(Boolean)
250
+ .join(' '));
251
+ }
252
+ else {
253
+ console.log([
254
+ ' ',
255
+ dimGrey(envString),
256
+ white(_substringAfterLast(cmd, '/')),
257
+ ...(opt.args || []),
258
+ ]
259
+ .filter(Boolean)
260
+ .join(' '));
261
+ }
251
262
  }
252
263
  logFinish(cmd, opt, started, isSuccessful) {
253
264
  if (isSuccessful && !opt.logFinish)
254
265
  return;
255
266
  console.log([
267
+ isSuccessful ? ' ✓' : ' ×',
256
268
  white(opt.name || _substringAfterLast(cmd, '/')),
257
269
  ...((!opt.name && opt.args) || []),
258
270
  dimGrey('took ' + _since(started)),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "15.19.0",
4
+ "version": "15.20.1",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@types/js-yaml": "^4",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/through2-concurrent": "^2",
26
- "@naturalcycles/dev-lib": "18.4.2"
26
+ "@naturalcycles/dev-lib": "19.32.0"
27
27
  },
28
28
  "exports": {
29
29
  ".": "./dist/index.js",
@@ -271,15 +271,28 @@ class Exec2 {
271
271
  private logStart(cmd: string, opt: SpawnOptions | ExecOptions): void {
272
272
  if (!opt.logStart) return
273
273
 
274
- console.log(
275
- [
276
- dimGrey(...Object.entries(opt.env || {}).map(([k, v]) => [k, v].join('='))),
277
- white(opt.name || _substringAfterLast(cmd, '/')),
278
- ...((!opt.name && (opt as SpawnOptions).args) || []),
279
- ]
280
- .filter(Boolean)
281
- .join(' '),
282
- )
274
+ const envString = Object.entries(opt.env || {})
275
+ .map(([k, v]) => [k, v].join('='))
276
+ .join(' ')
277
+
278
+ if (opt.name) {
279
+ console.log(
280
+ [' ', dimGrey(envString), white(opt.name), dimGrey('started...')]
281
+ .filter(Boolean)
282
+ .join(' '),
283
+ )
284
+ } else {
285
+ console.log(
286
+ [
287
+ ' ',
288
+ dimGrey(envString),
289
+ white(_substringAfterLast(cmd, '/')),
290
+ ...((opt as SpawnOptions).args || []),
291
+ ]
292
+ .filter(Boolean)
293
+ .join(' '),
294
+ )
295
+ }
283
296
  }
284
297
 
285
298
  private logFinish(
@@ -292,6 +305,7 @@ class Exec2 {
292
305
 
293
306
  console.log(
294
307
  [
308
+ isSuccessful ? ' ✓' : ' ×',
295
309
  white(opt.name || _substringAfterLast(cmd, '/')),
296
310
  ...((!opt.name && (opt as SpawnOptions).args) || []),
297
311
  dimGrey('took ' + _since(started)),