Skip to content

Commit

Permalink
Fix: Do not create settings file in User folder
Browse files Browse the repository at this point in the history
Removed logic to copy settings file into the user's Sublime Text User folder. This avoids unwanted file creation in the User directory, and ensures the settings file remains in the package directory.
  • Loading branch information
RedAtman committed Jul 31, 2024
1 parent 4a6a276 commit f08a20c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions _config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ def __init_subclass__(cls, **kwargs):
os.makedirs(SIMPLENOTE_PACKAGE_DIR, exist_ok=True)

SUBLIME_USER_DIR = os.path.join(packages_path(), "User")
SIMPLENOTE_SETTINGS_FILE_PATH = os.path.join(SUBLIME_USER_DIR, SIMPLENOTE_SETTINGS_FILE)
if not os.path.exists(SIMPLENOTE_SETTINGS_FILE_PATH):
import shutil
SIMPLENOTE_SETTINGS_FILE_PATH = SIMPLENOTE_SETTINGS_FILE
# SIMPLENOTE_SETTINGS_FILE_PATH = os.path.join(SUBLIME_USER_DIR, SIMPLENOTE_SETTINGS_FILE)
# if not os.path.exists(SIMPLENOTE_SETTINGS_FILE_PATH):
# import shutil

default_settings = os.path.join(os.path.dirname(__file__), SIMPLENOTE_SETTINGS_FILE)
shutil.copy(default_settings, SIMPLENOTE_SETTINGS_FILE_PATH)
# default_settings = os.path.join(os.path.dirname(__file__), SIMPLENOTE_SETTINGS_FILE)
# shutil.copy(default_settings, SIMPLENOTE_SETTINGS_FILE_PATH)

SIMPLENOTE_CACHE_DIR = os.path.join(cache_path(), SIMPLENOTE_PROJECT_NAME)
os.makedirs(SIMPLENOTE_CACHE_DIR, exist_ok=True)
Expand Down

0 comments on commit f08a20c

Please sign in to comment.