You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Extracts the command to run a script, from its shebang line. * @param scriptContents the script source code * @returns array of command and parameters */exportfunctionextractShebangCommand(scriptContents: string): string[]{returnscriptContents.split("\n")[0].replace(/^#!/,"").split(" ");}
...with the following edits:
TODO
Use .split("\n", 1) to not read more than necessary.
importargvSplitfrom"argv-split";/** * Extracts the command to run a script, from its shebang line. * @param scriptContents the script source code * @returns array of command and parameters */exportfunctionextractShebangCommand(scriptContents: string): string[]{returnargvSplit(scriptContents.split("\n",1)[0].replace(/^#!/,""));}
Add below function:
...with the following edits:
TODO
.split("\n", 1)
to not read more than necessary..split(" ")
.The text was updated successfully, but these errors were encountered: