Skip to content

Commit

Permalink
use join()
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Apr 20, 2016
1 parent a19afca commit 9cc8cf1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions chmod.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
]

def plugin_loaded():
from os.path import join
from package_control import events

# Get name of package folder
me = os.path.basename(os.path.dirname(os.path.realpath(__file__)))

if (events.install(me) or events.post_upgrade(me)) and os.name is 'posix' or 'mac':
if (events.install(package) or events.post_upgrade(package)) and os.name is 'posix' or 'mac':
for file in files:

# Concat full path
file_path = sublime.packages_path() + '/' + me + '/' + file
f = join(sublime.packages_path(), package + '/' + file)

# Change permissions, if file exists
if os.path.isfile(file_path):
st = os.stat(file_path)
os.chmod(file_path, st.st_mode | stat.S_IEXEC)
if os.path.isfile(f):
st = os.stat(f)
os.chmod(f, st.st_mode | stat.S_IEXEC)

0 comments on commit 9cc8cf1

Please sign in to comment.