@oisincoveney/pipeline 1.2.0 → 1.2.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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ interface PipeOptions {
|
|
|
12
12
|
export declare function pipe(description: string, options?: PipeOptions): Promise<void>;
|
|
13
13
|
export declare function createCliProgram(): Command;
|
|
14
14
|
export declare function runCli(argv: string[]): Promise<void>;
|
|
15
|
+
export declare function isCliEntrypoint(argv: string[]): boolean;
|
|
15
16
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -13010,6 +13010,8 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
13010
13010
|
});
|
|
13011
13011
|
|
|
13012
13012
|
// src/index.ts
|
|
13013
|
+
import { existsSync as existsSync7, realpathSync } from "node:fs";
|
|
13014
|
+
import { resolve } from "node:path";
|
|
13013
13015
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
13014
13016
|
|
|
13015
13017
|
// node_modules/commander/esm.mjs
|
|
@@ -37540,7 +37542,16 @@ function scriptName(argv) {
|
|
|
37540
37542
|
}
|
|
37541
37543
|
function isCliEntrypoint(argv) {
|
|
37542
37544
|
const name = scriptName(argv);
|
|
37543
|
-
|
|
37545
|
+
const entrypoint = normalizeEntrypointPath(argv[1]);
|
|
37546
|
+
const modulePath = normalizeEntrypointPath(fileURLToPath3(import.meta.url));
|
|
37547
|
+
return entrypoint === modulePath || name === "pipe" || name === "oisin-pipeline";
|
|
37548
|
+
}
|
|
37549
|
+
function normalizeEntrypointPath(path7) {
|
|
37550
|
+
if (!path7) {
|
|
37551
|
+
return;
|
|
37552
|
+
}
|
|
37553
|
+
const resolved = resolve(path7);
|
|
37554
|
+
return existsSync7(resolved) ? realpathSync(resolved) : resolved;
|
|
37544
37555
|
}
|
|
37545
37556
|
if (isCliEntrypoint(process.argv)) {
|
|
37546
37557
|
runCli(process.argv).catch((err) => {
|
|
@@ -37613,5 +37624,6 @@ function formatList(label, items) {
|
|
|
37613
37624
|
export {
|
|
37614
37625
|
runCli,
|
|
37615
37626
|
pipe2 as pipe,
|
|
37627
|
+
isCliEntrypoint,
|
|
37616
37628
|
createCliProgram
|
|
37617
37629
|
};
|