Skip to content

Commit

Permalink
fix os error
Browse files Browse the repository at this point in the history
  • Loading branch information
akashdhruv committed Oct 1, 2023
1 parent f32211e commit d69cf14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions jobrunner/api/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ def clean(workdir_list):
"""
# Get base directory
basedir = os.getcwd()
print(os.get_terminal_size().columns * "—")

try:
print(os.get_terminal_size().columns * "—")
except:
print(100 * "—")

# run cleanup
for workdir in workdir_list:
Expand All @@ -121,7 +125,11 @@ def archive(tag, workdir_list):
"""
# Get base directory
basedir = os.getcwd()
print(os.get_terminal_size().columns * "—")

try:
print(os.get_terminal_size().columns * "—")
except:
print(100 * "—")

# loop over workdir_list
for workdir in workdir_list:
Expand Down
6 changes: 5 additions & 1 deletion jobrunner/lib/_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ def DisplayTree(basedir, workdir):
"""
Display tree information on console
"""
print(os.get_terminal_size().columns * "—")
try:
print(os.get_terminal_size().columns * "—")
except:
print(100 * "—")

print(f"{lib.Color.purple}ROOT:{lib.Color.end} {basedir}")
print(f'{lib.Color.purple}NODE:{lib.Color.end} {workdir.replace(basedir,"<ROOT>")}')

Expand Down

0 comments on commit d69cf14

Please sign in to comment.