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':