Skip to content

Commit 6d53bbf

Browse files
committed
fix: recognize netlify dev and netlify dev:exec as distinct commands
see also: netlify/netlify-faunadb-example#36
1 parent 2e06694 commit 6d53bbf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/detectors/utils/jsdetect.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ const scanScripts = function ({ preferredScriptsArr, preferredCommand }) {
8080
/**
8181
* Throw if trying to call Netlify dev from within Netlify dev. Include
8282
* detailed information about the CLI setup in the error text.
83+
*
84+
* Do not include `netlify dev:exec`, etc., as they will not cause the CLI
85+
* to recursively call itself.
8386
*/
84-
if (scriptCommand.includes('netlify dev')) {
87+
if (/netlify dev(?!:)/.test(scriptCommand)) {
8588
throw new InternalCliError('Cannot call `netlify dev` inside `netlify dev`.', { packageJsonScripts })
8689
}
8790
/**

0 commit comments

Comments
 (0)