Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 8906ba9

Browse files
Merge pull request #57 from apfelchips/master
Fixed ack on windows
2 parents 55ab38f + c5423f0 commit 8906ba9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

searchengines/ack.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"subfolder")))
99
if cmd_subfolder not in sys.path:
1010
sys.path.insert(0, cmd_subfolder)
11+
1112
# Info:
1213
# cmd_folder = os.path.dirname(os.path.abspath(__file__)) # DO NOT USE __file__ !!!
1314
# __file__ fails if script is called in different ways on Windows
@@ -22,7 +23,8 @@ class Ack (base.Base):
2223
def __init__(self, settings):
2324
base.Base.__init__(self, settings)
2425
# Ubuntu's ack from repos is called ack-grep by default
25-
if 'Ubuntu' in os.uname()[3] and self.path_to_executable=='ack' and os.system('which ack-grep')==0:
26-
self.path_to_executable = 'ack-grep'
26+
if os.name!='nt': # no os.uname on Windows
27+
if 'Ubuntu' in os.uname()[3] and self.path_to_executable=='ack' and os.system('which ack-grep')==0:
28+
self.path_to_executable = 'ack-grep'
2729

2830
engine_class = Ack

0 commit comments

Comments
 (0)