From c4454dd22c68913df3e6bcf7982ba6f2d58c0ef0 Mon Sep 17 00:00:00 2001 From: Nathan Ross Date: Sat, 9 Jul 2016 21:25:45 -0400 Subject: [PATCH] call Heroku Toolbelt in shell mode on windows --- auralint.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/auralint.py b/auralint.py index fd9361a..0f17a37 100644 --- a/auralint.py +++ b/auralint.py @@ -6,6 +6,7 @@ """ import json import os +import shlex import subprocess import sublime @@ -15,7 +16,7 @@ settings = sublime.load_settings("Lightning.sublime-settings") FLAKE_DIR = os.path.dirname(os.path.abspath(__file__)) ERRORS_IN_VIEWS = {} - +IS_WINDOWS = os.name == 'nt' def update_statusbar(view): """Update status bar with error.""" @@ -64,10 +65,12 @@ def run(self, edit): folders = self.view.window().folders() print("Folders are " + folders[0]) + quote = lambda x: shlex.quote(x) if IS_WINDOWS else x p = subprocess.Popen(["heroku", "lightning:lint", - folders[0], "--files", filename, "--json"], + quote(folders[0]), "--files", quote(filename), "--json"], stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + stderr=subprocess.PIPE, + shell=IS_WINDOWS) print("Calling for results.") results, err = p.communicate() if err: