Skip to content

Commit

Permalink
+ .no-sublime-package file. https://git.io/vKMIS
Browse files Browse the repository at this point in the history
  • Loading branch information
kairyou committed Jul 22, 2016
1 parent 0a0192a commit 0058151
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .no-sublime-package
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.no-sublime-package
14 changes: 10 additions & 4 deletions sublime-tmpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,29 @@ def plugin_loaded(): # for ST3 >= 3016
# global PACKAGES_PATH
PACKAGES_PATH = sublime.packages_path()
TARGET_PATH = os.path.join(PACKAGES_PATH, PACKAGE_NAME)
# print(BASE_PATH, os.path.dirname(BASE_PATH))
# print(TARGET_PATH)
# print(BASE_PATH, os.path.dirname(BASE_PATH), TARGET_PATH)

# auto create custom_path
custom_path = os.path.join(PACKAGES_PATH, 'User', PACKAGE_NAME, TMLP_DIR)
# print(custom_path, os.path.isdir(custom_path))
if not os.path.isdir(custom_path):
os.makedirs(custom_path)

# first run
# try:
# from package_control import events
# if events.post_upgrade(PACKAGE_NAME):
# print('Upgraded to %s!' % events.post_upgrade(PACKAGE_NAME))
# except Exception as e:
# print(e)

# first run (https://git.io/vKMIS, does not need extract files)
if not os.path.isdir(TARGET_PATH):
os.makedirs(os.path.join(TARGET_PATH, TMLP_DIR))
# copy user files
tmpl_dir = TMLP_DIR + '/'
file_list = [
'Default.sublime-commands', 'Main.sublime-menu',
# if don't copy .py, ST3 throw: ImportError: No module named
# if don't copy .py, ST3 throw: ImportError: No module named # fix: restart sublime
'sublime-tmpl.py',
'README.md',
tmpl_dir + 'css.tmpl', tmpl_dir + 'html.tmpl',
Expand Down

0 comments on commit 0058151

Please sign in to comment.