@sorrell/cli-utilities 1.0.40 → 1.0.41
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/Distribution/PseudoTerminal/PseudoTerminal.Types.d.ts +14 -1
- package/Distribution/PseudoTerminal/PseudoTerminal.Types.d.ts.map +1 -1
- package/Distribution/PseudoTerminal/PseudoTerminal.d.ts +2 -1
- package/Distribution/PseudoTerminal/PseudoTerminal.d.ts.map +1 -1
- package/Distribution/PseudoTerminal/PseudoTerminal.js +12 -1
- package/Distribution/PseudoTerminal/PseudoTerminal.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,5 +4,18 @@
|
|
|
4
4
|
* @copyright (c) 2026 Gage Sorrell
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
import type { IPty as IPtyOriginal } from "node-pty";
|
|
8
|
+
/**
|
|
9
|
+
* The data that is supplied to the listener argument of
|
|
10
|
+
* {@link IPtyOriginal!onExit | onExit}.
|
|
11
|
+
*/
|
|
12
|
+
export type OnExitData = Parameters<Parameters<IPty["onExit"]>[0]>[0];
|
|
13
|
+
/**
|
|
14
|
+
* The {@link IPtyOriginal | IPty}, with an additional {@link Promise}
|
|
15
|
+
* {@link OnExit}, which resolves to the {@link OnExitData} for the
|
|
16
|
+
* given session.
|
|
17
|
+
*/
|
|
18
|
+
export interface IPty extends IPtyOriginal {
|
|
19
|
+
OnExit: Promise<OnExitData>;
|
|
20
|
+
}
|
|
8
21
|
//# sourceMappingURL=PseudoTerminal.Types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PseudoTerminal.Types.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.Types.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.Types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtE;;;;GAIG;AACH,MAAM,WAAW,IAAK,SAAQ,YAAY;IAEtC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;CAC/B"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @copyright (c) 2026 Gage Sorrell
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
7
|
+
import type { IPty } from "./PseudoTerminal.Types.js";
|
|
8
|
+
import { type IPtyForkOptions, type IWindowsPtyForkOptions } from "node-pty";
|
|
8
9
|
/**
|
|
9
10
|
* This function wraps {@link spawn} and provides sensible default options.
|
|
10
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PseudoTerminal.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.d.ts","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,2BAA2B,CAAC;AAClE,OAAO,EACH,KAAK,eAAe,EAEpB,KAAK,sBAAsB,EACpB,MAAM,UAAU,CAAC;AAI5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CACjB,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,KAAK,CAAC,MAAM,CAAO,EAC9B,OAAO,GAAE,eAAe,GAAG,sBAA4B,GACxD,IAAI,CA0CN"}
|
|
@@ -34,6 +34,17 @@ export function Spawn(Command, Arguments = [], Options = {}) {
|
|
|
34
34
|
...DefaultOptions,
|
|
35
35
|
...Options
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
const Out = spawn(GetCommandName(Command), Arguments, OutOptions);
|
|
38
|
+
let OnExitResolve;
|
|
39
|
+
const OnExit = new Promise((Resolve, _Reject) => {
|
|
40
|
+
OnExitResolve = Resolve;
|
|
41
|
+
});
|
|
42
|
+
Out.onExit((Data) => {
|
|
43
|
+
OnExitResolve(Data);
|
|
44
|
+
});
|
|
45
|
+
return {
|
|
46
|
+
...Out,
|
|
47
|
+
OnExit
|
|
48
|
+
};
|
|
38
49
|
}
|
|
39
50
|
//# sourceMappingURL=PseudoTerminal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PseudoTerminal.js","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"PseudoTerminal.js","sourceRoot":"","sources":["../../Source/PseudoTerminal/PseudoTerminal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAIH,KAAK,EAAE,MAAM,UAAU,CAAC;AAE5B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,KAAK,CACjB,OAAe,EACf,YAA2B,EAAG,EAC9B,UAAoD,EAAG;IAGvD,MAAM,cAAc,GAChB;QACI,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE;QAClC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,GAAG,EAAE,OAAO,CAAC,GAA6B;QAC1C,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;KAClC,CAAC;IAEN,MAAM,UAAU,GACZ;QACI,GAAG,cAAc;QACjB,GAAG,OAAO;KACb,CAAC;IAEN,MAAM,GAAG,GAAiB,KAAK,CAC3B,cAAc,CAAC,OAAO,CAAC,EACvB,SAAS,EACT,UAAU,CACb,CAAC;IAEF,IAAI,aAAmC,CAAC;IAExC,MAAM,MAAM,GAAmB,IAAI,OAAO,CAAa,CACnD,OAA6B,EAC7B,OAAgB,EACZ,EAAE;QAEN,aAAa,GAAG,OAAO,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,CAAC,IAAgB,EAAQ,EAAE;QAElC,aAAa,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,OAAO;QACH,GAAG,GAAG;QACN,MAAM;KACT,CAAC;AACN,CAAC"}
|