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;
55use std:: path:: { Path , PathBuf } ;
66use std:: process:: Command ;
77
8+ use build_helper:: ci:: CiEnv ;
89use ignore:: DirEntry ;
910
1011use crate :: walk:: walk_no_read;
@@ -14,15 +15,21 @@ pub(super) fn npm_install() -> Result<(), super::Error> {
1415 // disable a bunch of things we don't want.
1516 // this makes tidy output less noisy, and also significantly improves runtime
1617 // 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 ( ) ?;
2027 match child. wait ( ) {
2128 Ok ( exit_status) => {
2229 if exit_status. success ( ) {
2330 return Ok ( ( ) ) ;
2431 }
25- Err ( super :: Error :: FailedCheck ( "npm install failed " ) )
32+ Err ( super :: Error :: FailedCheck ( "npm install" ) )
2633 }
2734 Err ( error) => Err ( super :: Error :: Generic ( format ! ( "npm install failed: {error:?}" ) ) ) ,
2835 }
You can’t perform that action at this time.
0 commit comments