Skip to content

Expand sync folder path #27

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

Open
wants to merge 1 commit into
base: master
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
2 changes: 1 addition & 1 deletion Package Syncing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def run(self, mode=["pull", "push"], override=False):
settings = sublime.load_settings("Package Syncing.sublime-settings")

# Check for valid sync_folder
if not os.path.isdir(settings.get("sync_folder")):
if not os.path.isdir(tools.load_settings().get("sync_folder")):
sublime.error_message("Invalid sync folder \"%s\", sync disabled! Please adjust your sync folder." % settings.get("sync_folder"))
settings.set("sync", False)
sublime.save_settings("Package Syncing.sublime-settings")
Expand Down
6 changes: 5 additions & 1 deletion package_syncing/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
watcher_remote = None


def expandpath(path):
return os.path.expandvars(os.path.expanduser(path))


def load_settings():
s = sublime.load_settings("Package Syncing.sublime-settings")
return {
"sync": s.get("sync", False),
"sync_folder": s.get("sync_folder", False),
"sync_folder": expandpath(s.get("sync_folder")) if s.get("sync_folder", False) else False,
"sync_interval": s.get("sync_interval", 1),
"files_to_include": s.get("files_to_include", []),
"files_to_ignore": s.get("files_to_ignore", []),
Expand Down