-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup for apps-install script #3834
Conversation
18f737c
to
980384f
Compare
980384f
to
23bb897
Compare
scripts/npm/apps-install/index.js
Outdated
/* Check if node_modules directory exists in a particular app's folder. | ||
If it doesn't log the command to add it and don't process the scripts. */ | ||
/* Check if package.json exists in a particular app's folder. | ||
If it does, run npm install on that directory. */ | ||
const appsPath = `${ paths.unprocessed }/apps/${ app }`; | ||
// eslint-disable-next-line no-sync | ||
if ( fs.existsSync( `${ appsPath }/package.json` ) ) { | ||
exec( `npm --prefix ${ appsPath } install ${ appsPath }`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap this out for execSync.
. You want this to be blocking, you will need to modify the code to use try / catch
. See https://github.com/cfpb/cfgov-refresh/pull/3840/files#diff-269192501d1bd2ea09c118162a0ab16aR29
scripts/npm/apps-install/index.js
Outdated
// eslint-disable-next-line no-console | ||
console.log( `npm errors/warnings from ${ appsPath }: ${stderr}` ); | ||
} | ||
|
||
if ( error !== null ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to kill the process on error, especially since frontend.sh will complete and you won't be able to run the script again ( the checksum value gets added ).
ff74c9d
to
82cab4e
Compare
@sebworks please re-pull and check pls! |
💯, I'm not sure on the linting error. |
I removed the final if statement, because if |
Address @Scotchester comments in #3831
Removals
package-lock.json
.Changes
Testing