Skip to content

Commit 92c1025

Browse files
committed
Support file paths with spaces
Adds support for the directory the script is saved in to contain spaces. SQLPLUS has issues with spaces in filenames so we need to set the working directory to the one the script is in and then send SQLPLUS the script without the path.
1 parent a79eb7b commit 92c1025

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

oracle_exec.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ def run(self, dsn="", **kwargs):
2020
sqlfilter = "\"''\""
2121
else:
2222
sqlfilter = '"' + ",".join("'%s'" % entity for entity in self.entities.keys()) + '"'
23-
24-
cmd = ["sqlplus.exe", "-s", dsn, "@", os.path.join(sublime.packages_path(), 'OracleSQL', 'RunSQL.sql'),
25-
self.window.active_view().file_name(), sqlfilter]
2623

27-
super(OracleExecCommand, self).run(cmd, "^Filename: (.+)$", "^\\(.+?/([0-9]+):([0-9]+)\\) [0-9]+:[0-9]+ (.+)$", **kwargs)
24+
(directory, filename) = os.path.split(self.window.active_view().file_name())
25+
cmd = ["sqlplus.exe", "-s", dsn, "@", os.path.join(sublime.packages_path(), 'OracleSQL', 'RunSQL.sql'), '"'+filename+'"', sqlfilter]
26+
27+
super(OracleExecCommand, self).run(cmd, "^Filename: (.+)$", "^\\(.+?/([0-9]+):([0-9]+)\\) [0-9]+:[0-9]+ (.+)$", working_dir=directory, **kwargs)
2828

2929
def append_data(self, proc, data):
3030
# Update the line number of output_view with the correct line number of source view

0 commit comments

Comments
 (0)