Skip to content

Commit

Permalink
fix: recognize netlify dev and netlify dev:exec as distinct commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjlewis committed Jan 24, 2021
1 parent 2e06694 commit 6d53bbf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/detectors/utils/jsdetect.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ const scanScripts = function ({ preferredScriptsArr, preferredCommand }) {
/**
* Throw if trying to call Netlify dev from within Netlify dev. Include
* detailed information about the CLI setup in the error text.
*
* Do not include `netlify dev:exec`, etc., as they will not cause the CLI
* to recursively call itself.
*/
if (scriptCommand.includes('netlify dev')) {
if (/netlify dev(?!:)/.test(scriptCommand)) {
throw new InternalCliError('Cannot call `netlify dev` inside `netlify dev`.', { packageJsonScripts })
}
/**
Expand Down

0 comments on commit 6d53bbf

Please sign in to comment.