Skip to content

Commit

Permalink
Merge pull request #62
Browse files Browse the repository at this point in the history
CLI: Quote script arguments in error message
  • Loading branch information
PedramBakh committed Sep 13, 2023
2 parents bc962f4 + 11b085c commit e240453
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion carbontracker/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
import shlex
import subprocess
from carbontracker.tracker import CarbonTracker
import ast
Expand All @@ -25,7 +26,7 @@ def main():
try:
subprocess.run(args.command, check=True)
except subprocess.CalledProcessError:
print(f"Error executing command: {' '.join(args.command)}")
print(f"Error executing command: {' '.join(map(shlex.quote, args.command))}")
# Handle errors or exceptions if needed

tracker.epoch_end()
Expand Down

0 comments on commit e240453

Please sign in to comment.