File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/tools/tidy/src/ext_tool_checks Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use std::ffi::OsStr;
5
5
use std:: path:: { Path , PathBuf } ;
6
6
use std:: process:: Command ;
7
7
8
+ use build_helper:: ci:: CiEnv ;
8
9
use ignore:: DirEntry ;
9
10
10
11
use crate :: walk:: walk_no_read;
@@ -14,15 +15,21 @@ pub(super) fn npm_install() -> Result<(), super::Error> {
14
15
// disable a bunch of things we don't want.
15
16
// this makes tidy output less noisy, and also significantly improves runtime
16
17
// of repeated tidy invokations.
17
- let mut child = Command :: new ( "npm" )
18
- . args ( & [ "install" , "--audit=false" , "--save=false" , "--fund=false" ] )
19
- . spawn ( ) ?;
18
+ let mut cmd = Command :: new ( "npm" ) ;
19
+ if CiEnv :: is_ci ( ) {
20
+ // `npm ci` redownloads every time and thus is too slow for local development.
21
+ cmd. arg ( "ci" ) ;
22
+ } else {
23
+ cmd. arg ( "install" ) ;
24
+ }
25
+ cmd. args ( & [ "--audit=false" , "--save=false" , "--fund=false" ] ) ;
26
+ let mut child = cmd. spawn ( ) ?;
20
27
match child. wait ( ) {
21
28
Ok ( exit_status) => {
22
29
if exit_status. success ( ) {
23
30
return Ok ( ( ) ) ;
24
31
}
25
- Err ( super :: Error :: FailedCheck ( "npm install failed " ) )
32
+ Err ( super :: Error :: FailedCheck ( "npm install" ) )
26
33
}
27
34
Err ( error) => Err ( super :: Error :: Generic ( format ! ( "npm install failed: {error:?}" ) ) ) ,
28
35
}
You can’t perform that action at this time.
0 commit comments