summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-10-11 17:52:32 +0200
committerhut <hut@lepus.uberspace.de>2014-10-11 17:54:45 +0200
commit76788499997b7e7bff4cd27b9202aa83e9e39fd0 (patch)
tree3640355c6265b80d5cb1b02fda68af5e27d9acd8
parent6ad0d82c6d9d0f552dd6374dce84e79864e08d9e (diff)
downloadranger-76788499997b7e7bff4cd27b9202aa83e9e39fd0.tar.gz
rifle.py: expand environment variables in "has" function
-rwxr-xr-xranger/ext/rifle.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py
index 1cc2dcf8..4033d639 100755
--- a/ranger/ext/rifle.py
+++ b/ranger/ext/rifle.py
@@ -210,7 +210,12 @@ class Rifle(object):
         elif function == 'mime':
             return bool(re.search(argument, self._get_mimetype(files[0])))
         elif function == 'has':
-            return argument in get_executables()
+            if argument.startswith("$"):
+                if argument[1:] in os.environ:
+                    return os.environ[argument[1:]] in get_executables()
+                return False
+            else:
+                return argument in get_executables()
         elif function == 'terminal':
             return _is_terminal()
         elif function == 'number':
1.7.0&id=110dd383d250c20b1bf74f059f8f996d81a6d123'>110dd383 ^
26962ded ^
110dd383 ^








a0e543f8 ^
110dd383 ^

26962ded ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56