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

Add Windows AppData support #1954

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 mackup/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Support platforms
PLATFORM_DARWIN = "Darwin"
PLATFORM_LINUX = "Linux"
PLATFORM_WINDOWS = "Windows"

# Directory containing the application configs
APPS_DIR = "applications"
Expand Down
11 changes: 10 additions & 1 deletion mackup/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,17 @@ def can_file_be_synced_on_current_platform(path):
# not any file/folder named LibrarySomething
library_path = os.path.join(os.environ["HOME"], "Library/")

if platform.system() == constants.PLATFORM_LINUX:
if platform.system() == constants.PLATFORM_LINUX or platform.system() == constants.PLATFORM_WINDOWS:
if fullpath.startswith(library_path):
can_be_synced = False

# Compute the ~/AppData path on Windows
# End it with a slash because we are looking for this specific folder and
# not any file/folder named AppDataSomething
appdata_path = os.path.join(os.environ["HOME"], "AppData/")

if platform.system() == constants.PLATFORM_LINUX or platform.system() == constants.PLATFORM_DARWIN:
if fullpath.startswith(appdata_path):
can_be_synced = False

return can_be_synced
Loading