@j-o-r/sh 1.0.1 → 1.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.
Files changed (2) hide show
  1. package/lib/sh.js +3 -2
  2. package/package.json +1 -1
package/lib/sh.js CHANGED
@@ -1,3 +1,4 @@
1
+ import assert from 'node:assert';
1
2
  import { spawnSync, spawn, exec } from 'node:child_process';
2
3
 
3
4
  // timeout when a process becomes inresponsive
@@ -118,7 +119,7 @@ class SHExecute {
118
119
  if (to > 0) {
119
120
  timeout = setTimeout(async () => {
120
121
  await this.#proc.kill();
121
- reject(new Error('Process timed out'));
122
+ reject(new Error(`Process timed out: ${this.#command}`));
122
123
  }, to); // options.timeout
123
124
  }
124
125
  this.#proc.on('close', (code) => {
@@ -322,7 +323,6 @@ class SHDispatch {
322
323
  // Modified by: jorrit.duin+sh[AT]gmail.com
323
324
 
324
325
 
325
-
326
326
  /**
327
327
  * Creates a new SHDispatch object that represents a command to be executed.
328
328
  *
@@ -485,6 +485,7 @@ const retry = async (count, a, b) => {
485
485
  let delay = 0;
486
486
  if (delayStatic > 0)
487
487
  delay = delayStatic;
488
+ // @ts-ignore
488
489
  if (delayGen) delay = delayGen.next().value;
489
490
  lastErr = err;
490
491
  if (count == 0)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@j-o-r/sh",
3
3
  "author": "Jorrit Duin <j-o-r@duin.work>",
4
4
  "type": "module",
5
- "version": "1.0.1",
5
+ "version": "1.0.2",
6
6
  "description": "Execute shell commands on Linux-based systems from javascript",
7
7
  "main": "lib/sh.js",
8
8
  "engines": {