Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
- [Peter Yasi](https://github.com/pyasi)
- [Nicole Tibay](https://github.com/neequole)
- [Rods](https://github.com/rods-honorio)
- [Jerome Brown](https://github.com/oWretch)
9 changes: 5 additions & 4 deletions shallow_backup/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ def backup_configs(backup_path, dry_run: bool = False, skip=False):
continue

quoted_dest = quote(dest)
Copy link
Owner

@alichtman alichtman Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is also a problem for dest / quoted_dest.

if os.path.isdir(config_path):
copytree(config_path, quoted_dest, symlinks=True)
elif os.path.isfile(config_path):
expanded_path = os.path.expandvars(os.path.expanduser(config_path))
if os.path.isdir(expanded_path):
copytree(expanded_path, quoted_dest, symlinks=True)
elif os.path.isfile(expanded_path):
parent_dir = Path(dest).parent
safe_mkdir(parent_dir)
copyfile(config_path, quoted_dest)
copyfile(expanded_path, quoted_dest)


def backup_packages(backup_path, dry_run: bool = False, skip=False):
Expand Down