From d17052a31d258f6547c893ab46d0b37614f8a108 Mon Sep 17 00:00:00 2001 From: dahlo Date: Thu, 8 Feb 2024 08:32:27 +0100 Subject: [PATCH] Changed to absoulte paths for all user defined paths. --- .gitignore | 1 + darsync.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 08bf01c..15b1fc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.log *.slurm *.sw* +*.gz diff --git a/darsync.py b/darsync.py index 53563d8..03800fe 100755 --- a/darsync.py +++ b/darsync.py @@ -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 @@ -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} @@ -415,6 +418,9 @@ def gen_slurm_script(args): """) print(f""" + + + Created SLURM script: {outfile} containing the following command: