@esportsplus/typescript 0.8.7 → 0.8.8
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/bin/tsc +22 -5
- package/bin/tsc-alias +22 -5
- package/package.json +1 -1
package/bin/tsc
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
require('child_process')
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
)
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function find(script) {
|
|
8
|
+
let dir = process.cwd();
|
|
9
|
+
|
|
10
|
+
while (dir !== path.parse(dir).root) {
|
|
11
|
+
let filepath = path.resolve(dir, `node_modules/.bin/${script}`);
|
|
12
|
+
|
|
13
|
+
if (fs.existsSync(filepath)) {
|
|
14
|
+
return filepath;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dir = path.dirname(dir);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(`@esportsplus/cli-passthrough: ${script} could not be found`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
spawn(find('tsc'), process.argv.slice(2), { shell: true, stdio: 'inherit' });
|
package/bin/tsc-alias
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
require('child_process')
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
)
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
function find(script) {
|
|
8
|
+
let dir = process.cwd();
|
|
9
|
+
|
|
10
|
+
while (dir !== path.parse(dir).root) {
|
|
11
|
+
let filepath = path.resolve(dir, `node_modules/.bin/${script}`);
|
|
12
|
+
|
|
13
|
+
if (fs.existsSync(filepath)) {
|
|
14
|
+
return filepath;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
dir = path.dirname(dir);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
throw new Error(`@esportsplus/cli-passthrough: ${script} could not be found`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
spawn(find('tsc-alias'), process.argv.slice(2), { shell: true, stdio: 'inherit' });
|
package/package.json
CHANGED