@regardio/dev 1.14.2 → 1.14.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.ts"],"names":[],"mappings":";AAaA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAQpE"}
1
+ {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../src/bin/exec/clean.ts"],"names":[],"mappings":";AAcA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAQpE"}
@@ -2,6 +2,7 @@
2
2
  import { spawn } from 'node:child_process';
3
3
  import { createRequire } from 'node:module';
4
4
  import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
5
6
  export function resolveRimrafBin(require) {
6
7
  const pkgPath = require.resolve('rimraf/package.json');
7
8
  const pkg = require(pkgPath);
@@ -11,12 +12,14 @@ export function resolveRimrafBin(require) {
11
12
  const normalized = binRel.startsWith('./') ? binRel.slice(2) : binRel;
12
13
  return path.join(path.dirname(pkgPath), normalized);
13
14
  }
14
- const require = createRequire(import.meta.url);
15
- const bin = resolveRimrafBin(require);
16
- if (!bin) {
17
- console.error('Unable to locate rimraf binary from package.json bin field');
18
- process.exit(1);
15
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
16
+ const require = createRequire(import.meta.url);
17
+ const bin = resolveRimrafBin(require);
18
+ if (!bin) {
19
+ console.error('Unable to locate rimraf binary from package.json bin field');
20
+ process.exit(1);
21
+ }
22
+ const args = process.argv.slice(2);
23
+ const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
24
+ child.on('exit', (code) => process.exit(code ?? 0));
19
25
  }
20
- const args = process.argv.slice(2);
21
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
22
- child.on('exit', (code) => process.exit(code ?? 0));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://www.schemastore.org/package.json",
3
3
  "name": "@regardio/dev",
4
- "version": "1.14.2",
4
+ "version": "1.14.3",
5
5
  "private": false,
6
6
  "description": "Regardio developer tooling for testing, linting, and build workflows",
7
7
  "keywords": [
@@ -6,6 +6,7 @@
6
6
  import { spawn } from 'node:child_process';
7
7
  import { createRequire } from 'node:module';
8
8
  import path from 'node:path';
9
+ import { fileURLToPath } from 'node:url';
9
10
 
10
11
  /**
11
12
  * Resolve the absolute path to the rimraf binary from its package.json bin field.
@@ -21,13 +22,15 @@ export function resolveRimrafBin(require: NodeRequire): string | null {
21
22
  return path.join(path.dirname(pkgPath), normalized);
22
23
  }
23
24
 
24
- const require = createRequire(import.meta.url);
25
- const bin = resolveRimrafBin(require);
26
- if (!bin) {
27
- console.error('Unable to locate rimraf binary from package.json bin field');
28
- process.exit(1);
29
- }
25
+ if (process.argv[1] === fileURLToPath(import.meta.url)) {
26
+ const require = createRequire(import.meta.url);
27
+ const bin = resolveRimrafBin(require);
28
+ if (!bin) {
29
+ console.error('Unable to locate rimraf binary from package.json bin field');
30
+ process.exit(1);
31
+ }
30
32
 
31
- const args = process.argv.slice(2);
32
- const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
33
- child.on('exit', (code) => process.exit(code ?? 0));
33
+ const args = process.argv.slice(2);
34
+ const child = spawn(process.execPath, [bin, ...args], { stdio: 'inherit' });
35
+ child.on('exit', (code) => process.exit(code ?? 0));
36
+ }