Skip to content
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

26 use npm ci instead of npm install #27

Merged
merged 2 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Robo/Plugin/Commands/BuildJsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function buildJs(ConsoleIO $io) {
$root = preg_replace('(\/web|\/docroot)', '', $root);
$tasks = $this->collectionBuilder($io);
if (file_exists($root . '/.nvmrc') && getenv('NVM_DIR')) {
$command = 'export NVM_DIR=$HOME/.nvm && source $NVM_DIR/nvm.sh && cd ' . $root . ' && nvm install && npm install && cd -';
$command = 'export NVM_DIR=$HOME/.nvm && . $NVM_DIR/nvm.sh && cd ' . $root . ' && nvm install && npm ci && cd -';
$tasks->addTask($this->taskExec($command)->printOutput(TRUE));
}
elseif (file_exists($root . '/package.json')) {
Expand Down
4 changes: 2 additions & 2 deletions src/Robo/Plugin/Commands/BuildThemeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function buildTheme(ConsoleIO $io) {
$root = $this->getThemePath();
$tasks = $this->collectionBuilder($io);
$npmCommand = Robo::config()->get('local_theme_build_script');
$command = 'cd ' . $root . ' && npm install && npm run ' . $npmCommand;
$command = 'cd ' . $root . ' && npm ci && npm run ' . $npmCommand;
if (file_exists($root . '/.nvmrc') && getenv('NVM_DIR')) {
$command = 'export NVM_DIR=$HOME/.nvm && source $NVM_DIR/nvm.sh && cd ' . $root . ' && nvm install && npm install && npm run ' . $npmCommand;
$command = 'export NVM_DIR=$HOME/.nvm && . $NVM_DIR/nvm.sh && cd ' . $root . ' && nvm install && npm ci && npm run ' . $npmCommand;
}
$tasks->taskExec($command);
return $tasks;
Expand Down