diff options
author | hut <hut@lepus.uberspace.de> | 2014-10-11 17:52:32 +0200 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2014-10-11 17:54:45 +0200 |
commit | 76788499997b7e7bff4cd27b9202aa83e9e39fd0 (patch) | |
tree | 3640355c6265b80d5cb1b02fda68af5e27d9acd8 | |
parent | 6ad0d82c6d9d0f552dd6374dce84e79864e08d9e (diff) | |
download | ranger-76788499997b7e7bff4cd27b9202aa83e9e39fd0.tar.gz |
rifle.py: expand environment variables in "has" function
-rwxr-xr-x | ranger/ext/rifle.py | 7 |
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': |