Skip to content

Commit

Permalink
Changed to absoulte paths for all user defined paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlo committed Feb 8, 2024
1 parent 7c68aee commit d17052a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.log
*.slurm
*.sw*
*.gz
12 changes: 9 additions & 3 deletions darsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ def check_file_tree(args):
prefix = f"darsync_{os.path.basename(os.path.abspath(local_dir))}"

# expand tilde
local_dir = os.path.expanduser(local_dir)
prefix = os.path.expanduser(prefix)
local_dir = os.path.abspath(os.path.expanduser(local_dir))
prefix = os.path.abspath(os.path.expanduser(prefix))

# Initialize variables for tracking file counts and sizes
total_size = 0
Expand Down Expand Up @@ -379,10 +379,13 @@ def gen_slurm_script(args):
outfile_default = f"darsync_{os.path.basename(os.path.abspath(local_dir))}.slurm"

outfile = args.outfile or input(msg("input_outfile", outfile_default=outfile_default)) or outfile_default
outfile = os.path.expanduser(outfile)
outfile = os.path.abspath(os.path.expanduser(outfile))

if args.dryrun:
print(f"""
Dry run.
Would have created SLURM script: {outfile}
Expand Down Expand Up @@ -415,6 +418,9 @@ def gen_slurm_script(args):
""")

print(f"""
Created SLURM script: {outfile}
containing the following command:
Expand Down

0 comments on commit d17052a

Please sign in to comment.