File tree 3 files changed +10
-23
lines changed
3 files changed +10
-23
lines changed Original file line number Diff line number Diff line change 7
7
"eslint.nodePath" : " .yarn/sdks" ,
8
8
"typescript.enablePromptUseWorkspaceTsdk" : true ,
9
9
"editor.codeActionsOnSave" : {
10
- "source.fixAll" : true ,
11
10
"source.fixAll.eslint" : true
12
11
}
13
12
}
Original file line number Diff line number Diff line change 1
- import cmdShim from '@zkochan/cmd-shim' ;
2
- import fs from 'fs' ;
3
- import { SupportedPackageManagers } from 'sources/types' ;
1
+ import cmdShim from '@zkochan/cmd-shim' ;
2
+ import fs from 'fs' ;
4
3
5
- import config from './config.json' ;
4
+ import { Engine } from './sources/Engine' ;
5
+ import { SupportedPackageManagerSet } from './sources/types' ;
6
+
7
+ const engine = new Engine ( ) ;
6
8
7
9
async function main ( ) {
8
- for ( const packageManager of Object . keys ( config . definitions ) as Array < SupportedPackageManagers > ) {
9
- const binSet = new Set < string > ( ) ;
10
-
11
- for ( const spec of Object . values ( config . definitions [ packageManager ] . ranges ) ) {
12
- if ( Array . isArray ( spec . bin ) ) {
13
- for ( const entry of spec . bin ) {
14
- binSet . add ( entry ) ;
15
- }
16
- } else {
17
- for ( const entry of Object . keys ( spec . bin ) ) {
18
- binSet . add ( entry ) ;
19
- }
20
- }
21
- }
10
+ for ( const packageManager of SupportedPackageManagerSet ) {
11
+ const binSet = engine . getBinariesFor ( packageManager ) ;
22
12
23
13
for ( const binaryName of binSet ) {
24
14
const entryPath = `${ __dirname } /dist/${ binaryName } .js` ;
Original file line number Diff line number Diff line change @@ -95,8 +95,6 @@ export function runMain(argv: Array<string>) {
95
95
} ) ;
96
96
}
97
97
98
- declare const __non_webpack_require__ : any ;
99
-
100
- if ( typeof __non_webpack_require__ === `undefined` && process . mainModule === module )
98
+ // Using `eval` to be sure that Webpack doesn't transform it
99
+ if ( process . mainModule === eval ( `module` ) )
101
100
runMain ( process . argv . slice ( 2 ) ) ;
102
-
You can’t perform that action at this time.
0 commit comments