Skip to content

Commit

Permalink
Merge pull request #7 from nickel715/patch-1
Browse files Browse the repository at this point in the history
Fix #6 problems with spaces in path on windows
  • Loading branch information
hgraca committed Aug 20, 2013
2 parents 15a84fd + 138223b commit 459dbc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sublime-text-2-php-refactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import subprocess
from os.path import basename

installed_dir = os.path.basename(os.getcwd())

'''
Global function to send system messages
Expand All @@ -16,7 +17,7 @@ def msg(msg):


def shellquote(s):
return "'" + s.replace("'", "'\\''") + "'"
return "\"" + s.replace("\"", "\\\"") + "\""

'''
Plugin preferences
Expand Down Expand Up @@ -44,7 +45,7 @@ def load():


class Refactor():
REFACTOR = shellquote(sublime.packages_path()) + "/sublime-text-2-php-refactor/lib/refactor.phar"
REFACTOR = shellquote(os.path.normpath(sublime.packages_path() + os.sep + installed_dir + os.sep + "lib" + os.sep + "refactor.phar"))

def execute(self, name, command, execute=False):

Expand Down

0 comments on commit 459dbc4

Please sign in to comment.