Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

fix npm run bug with execa #111

Merged
merged 1 commit into from
Apr 10, 2019
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
6 changes: 4 additions & 2 deletions src/commands/dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ function startDevServer(settings, log, error) {
return;
}
log(`${NETLIFYDEVLOG} Starting Netlify Dev with ${settings.type}`);
const ps = execa(settings.command, settings.args, {
const args =
settings.command === "npm" ? ["run", ...settings.args] : settings.args;
const ps = execa(settings.command, args, {
env: settings.env,
stdio: "inherit"
});
Expand All @@ -167,7 +169,7 @@ function startDevServer(settings, log, error) {

class DevCommand extends Command {
async run() {
this.log(`${NETLIFYDEV} Starting...`);
this.log(`${NETLIFYDEV}`);
let { flags } = this.parse(DevCommand);
const { api, site, config } = this.netlify;
const functionsDir =
Expand Down
2 changes: 1 addition & 1 deletion src/detectors/utils/jsdetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getYarnOrNPMCommand() {
if (!yarnExists) {
yarnExists = existsSync("yarn.lock") ? "yes" : "no";
}
return yarnExists === "yes" ? "yarn" : "npm run";
return yarnExists === "yes" ? "yarn" : "npm";
}

/**
Expand Down