diff --git a/Main.sublime-menu b/Main.sublime-menu index 31c862a..0c98b33 100644 --- a/Main.sublime-menu +++ b/Main.sublime-menu @@ -1,82 +1,83 @@ [ - { - "caption": "Preferences", - "mnemonic": "n", - "id": "preferences", - "children": - [ - { - "caption": "Package Settings", - "mnemonic": "P", - "id": "package-settings", - "children": - [ - { - "caption": "Package Syncing", - "children": - [ - { - "caption": "Settings – Default", - "command": "open_file", "args": { "file": "${packages}/Package Syncing/Package Syncing.sublime-settings" } - }, - { - "caption": "Settings – User", - "command": "open_file", "args": { "file": "${packages}/User/Package Syncing.sublime-settings" } - } - ] - } - ] - } - ] - }, - { - "id": "tools", - "children": - [ - { - "caption": "Packages", - "id": "packages", - "children": - [ - { - "caption": "Package Syncing", - "children": - [ - { - "caption": "Enable Syncing", - "command": "pkg_sync_enable" - }, - { - "caption": "Disable Syncing", - "command": "pkg_sync_disable" - }, - { "caption": "-" }, - { - "caption": "Define Sync Folder", - "command": "pkg_sync_folder" - }, - { "caption": "-" }, - { - "caption": "Push Settings", - "command": "pkg_sync", "args": {"mode": ["push"]} - }, - { - "caption": "Pull Settings", - "command": "pkg_sync", "args": {"mode": ["pull"]} - }, - { "caption": "-" }, - { - "caption": "Settings – Default", - "command": "open_file", "args": { "file": "${packages}/Package Syncing/Package Syncing.sublime-settings" } - }, - { - "caption": "Settings – User", - "command": "open_file", "args": { "file": "${packages}/User/Package Syncing.sublime-settings" } - } - ] - } - ] - } - ] - } + { + "id": "tools", + "children": + [ + { + "caption": "Packages", + "id": "packages", + "children": + [ + { + "caption": "Package Syncing", + "children": + [ + { + "caption": "Enable Syncing", + "command": "pkg_sync_enable" + }, + { + "caption": "Disable Syncing", + "command": "pkg_sync_disable" + }, + { "caption": "-" }, + { + "caption": "Define Sync Folder", + "command": "pkg_sync_folder" + }, + { "caption": "-" }, + { + "caption": "Push Settings", + "command": "pkg_sync", "args": {"mode": ["push"]} + }, + { + "caption": "Pull Settings", + "command": "pkg_sync", "args": {"mode": ["pull"]} + } + ] + } + ] + } + ] + }, + { + "caption": "Preferences", + "mnemonic": "n", + "id": "preferences", + "children": + [ + { + "caption": "Package Settings", + "mnemonic": "P", + "id": "package-settings", + "children": + [ + { + "caption": "Package Syncing", + "children": + [ + { + "caption": "README", + "command": "open_file", + "args": {"file": "${packages}/Package Syncing/Readme.md"} + }, + { + "caption": "-" + }, + { + "caption": "Settings – Default", + "command": "open_file", + "args": { "file": "${packages}/Package Syncing/Package Syncing.sublime-settings" } + }, + { + "caption": "Settings – User", + "command": "open_file", + "args": { "file": "${packages}/User/Package Syncing.sublime-settings" } + } + ] + } + ] + } + ] + } ] diff --git a/package_syncing/thread.py b/package_syncing/thread.py index b0b22df..02a22b8 100644 --- a/package_syncing/thread.py +++ b/package_syncing/thread.py @@ -114,8 +114,9 @@ def find_files(self, path): [dir_names.remove(dir) for dir in dir_names if dir in dirs_to_ignore] for file_name in file_names: - full_path = os.path.join(root, file_name) - rel_path = os.path.relpath(full_path, path) + file_name = file_name.lower() # We can't use fn as a key if Dropbox autoconverts it to lowercase on Windows! + full_path = os.path.join(root, file_name).lower() + rel_path = os.path.relpath(full_path, path).lower() include_matches = [fnmatch.fnmatch(rel_path, p) for p in files_to_include] ignore_matches = [fnmatch.fnmatch(rel_path, p) for p in files_to_ignore] @@ -175,7 +176,8 @@ def pull(self, item): last_remote_data = last_data.get("last_remote_data", {}) # Make target file path and directory - target = os.path.join(local_dir, item["key"]) + target_fn = item["key"] + target = os.path.join(local_dir, target_fn) target_dir = os.path.dirname(target) # Skip if file was just pushed