This commit is contained in:
Song Zheng 2023-07-30 18:17:10 -07:00 committed by GitHub
commit 357aba69fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,10 +8,10 @@ enabled_by_default = npm_available
@for_app('npm')
def match(command):
return (any(part.startswith('ru') for part in command.script_parts)
and 'npm ERR! missing script: ' in command.output)
and 'npm ERR! Missing script: ' in command.output)
def get_new_command(command):
misspelled_script = re.findall(
r'.*missing script: (.*)\n', command.output)[0]
r'.*Missing script: "(.*)"\n', command.output)[0]
return replace_command(command, misspelled_script, get_scripts())