Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable resolution of variables in config paths #316

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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 = expand_to_abs_path(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