mirror of
https://github.com/Llewellynvdm/zoxide.git
synced 2024-11-10 23:30:57 +00:00
parent
56218f35d3
commit
f4cf811155
@ -25,14 +25,12 @@ class z(ranger.api.commands.Command):
|
|||||||
output = subprocess.check_output(["zoxide", "query"] + self.args[1:])
|
output = subprocess.check_output(["zoxide", "query"] + self.args[1:])
|
||||||
output = output.decode("utf-8")
|
output = output.decode("utf-8")
|
||||||
|
|
||||||
query_prefix = "query: "
|
directory = output.strip()
|
||||||
|
self.fm.cd(directory)
|
||||||
if output.startswith(query_prefix):
|
self.fm.notify(directory)
|
||||||
directory = output[len(query_prefix) :].strip()
|
except subprocess.CalledProcessError as e:
|
||||||
self.fm.cd(directory)
|
if e.returncode == 1:
|
||||||
self.fm.notify(directory)
|
pass
|
||||||
else:
|
|
||||||
self.fm.notify("no match found", bad=True)
|
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.fm.notify(e, bad=True)
|
self.fm.notify(e, bad=True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user