File tree Expand file tree Collapse file tree 4 files changed +35
-8
lines changed Expand file tree Collapse file tree 4 files changed +35
-8
lines changed Original file line number Diff line number Diff line change 3431
3431
}
3432
3432
},
3433
3433
"scripts" : {
3434
+ "prepare" : " ts-node ./scripts/build/prepare.ts" ,
3434
3435
"vscode:prepublish" : " npm run clean && npm run buildScripts && webpack --mode production && npm run copyFiles -- --webpacked" ,
3435
3436
"clean" : " ts-node ./scripts/clean.ts dist" ,
3436
3437
"reset" : " npm run clean -- node_modules && npm install" ,
Original file line number Diff line number Diff line change
1
+ /*!
2
+ * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ //
7
+ // Performs NPM "prepare" step, except when running in CI.
8
+ //
9
+ // prepare: https://docs.npmjs.com/cli/v9/using-npm/scripts#prepare-and-prepublish:
10
+ // - Runs BEFORE the package is packed, i.e. during "npm publish" AND "npm pack".
11
+ // - Runs on local "npm install".
12
+ // - Runs AFTER `prepublish`, but BEFORE `prepublishOnly`.
13
+ // - Runs in the background. To see the output, run with "--foreground-scripts".
14
+ //
15
+
16
+ import * as child_process from 'child_process'
17
+
18
+ /**
19
+ * Returns true if the current build is running on CI (build server).
20
+ */
21
+ export function isCI ( ) : boolean {
22
+ return undefined !== process . env [ 'GITHUB_ACTION' ] || undefined !== process . env [ 'CODEBUILD_BUILD_ID' ]
23
+ }
24
+
25
+ function main ( ) {
26
+ if ( isCI ( ) ) {
27
+ console . log ( 'prepare: skipped (running in CI)' )
28
+ return
29
+ }
30
+ child_process . execSync ( 'husky install' , { stdio : 'inherit' } )
31
+ }
32
+
33
+ main ( )
Original file line number Diff line number Diff line change @@ -332,11 +332,4 @@ export class SystemUtilities {
332
332
getLogger ( ) . warn ( 'findBashPath: failed: %s' , proc )
333
333
}
334
334
}
335
-
336
- /**
337
- * Returns true if the current build is running on CI (build server).
338
- */
339
- public static isCI ( ) : boolean {
340
- return undefined !== process . env [ 'CODEBUILD_BUILD_ID' ]
341
- }
342
335
}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ class DefaultEnv implements Env {
37
37
* Returns true if the current build is running on CI (build server).
38
38
*/
39
39
export function isCI ( ) : boolean {
40
- return undefined !== process . env [ 'CODEBUILD_BUILD_ID' ]
40
+ return undefined !== process . env [ 'GITHUB_ACTION' ] || undefined !== process . env [ ' CODEBUILD_BUILD_ID']
41
41
}
42
42
43
43
/** Variable added via webpack */
You can’t perform that action at this time.
0 commit comments