Skip to content

Commit 02df267

Browse files
refactor: set check flag to True
`subprocess.run` uses a default of `check=False`, which means that a nonzero exit code will be ignored by default, instead of raising an exception. You can ignore this issue if this behaviour is intended.
1 parent 059ccc7 commit 02df267

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/npm_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def install_npm(lib):
77
print(f"📦 Installing npm package: {lib} ...")
8-
result = run(["npm", "list", lib], stdout=PIPE, stderr=PIPE, text=True)
8+
result = run(["npm", "list", lib], stdout=PIPE, stderr=PIPE, text=True, check=True)
99
if lib in result.stdout:
1010
print(f"✅ {lib} already installed")
1111
return
@@ -16,7 +16,7 @@ def install_npm(lib):
1616
stdout=PIPE,
1717
stderr=PIPE,
1818
text=True,
19-
)
19+
check=True)
2020
if result.returncode == 0:
2121
print(f"✅ {lib} installed successfully")
2222
else:

0 commit comments

Comments
 (0)