Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
fix crashing when winscp is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
thecotne committed Apr 7, 2015
1 parent 38f43ec commit f804866
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions browseWithWinSCP.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .dirConfig import getConfig

configName = 'sftp-config.json'
winscpExe = None

for programFilesVar in ['ProgramFiles', 'ProgramFiles(x86)']:
try:
Expand All @@ -12,10 +13,12 @@
except KeyError:
pass

startWinscpCommand = '"'+ winscpExe + '"' + ' {type}://{user}:{password}@{host}:{port}"{remote_path}"'
if winscpExe:
startWinscpCommand = '"'+ winscpExe + '"' + ' {type}://{user}:{password}@{host}:{port}"{remote_path}"'

class browse_with_winscpCommand(sublime_plugin.WindowCommand):
def run(self, edit = None):
conf = getConfig(configName)
if conf is not None:
subprocess.Popen(startWinscpCommand.format(**conf), shell=True)

class browse_with_winscpCommand(sublime_plugin.WindowCommand):
def run(self, edit = None):
conf = getConfig(configName)
if conf is not None:
subprocess.Popen(startWinscpCommand.format(**conf), shell=True)

0 comments on commit f804866

Please sign in to comment.