Skip to content

Commit 9f0d969

Browse files
authored
Support URLs instead of traditional file paths
Closing issue #2
1 parent cc81204 commit 9f0d969

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

openbash/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
from fman import DirectoryPaneCommand
21
import subprocess
2+
from fman import DirectoryPaneCommand
3+
from fman.url import splitscheme, as_human_readable
34

45
class OpenBash(DirectoryPaneCommand):
56
def __call__(self):
6-
subprocess.call('C:/Program Files/Git/git-bash.exe --cd="{cd}"'.format(cd=self.pane.get_path()))
7+
url = self.pane.get_path()
8+
scheme, path = splitscheme(url)
9+
if scheme != 'file://':
10+
show_alert('Not supported.')
11+
return
12+
local_path = as_human_readable(url)
13+
subprocess.call('C:/Program Files/Git/git-bash.exe --cd="{cd}"'.format(cd=local_path))

0 commit comments

Comments
 (0)