mirror of
https://github.com/radareorg/r2env.git
synced 2026-11-08 08:49:34 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d65172542 | ||
|
|
94f25d4132 | ||
|
|
789025229d | ||
|
|
7513c6d1b6 | ||
|
|
f097dbb7c5 |
No files matched your search
+7
-3
@@ -87,11 +87,15 @@ class R2Env:
|
||||
|
||||
@staticmethod
|
||||
def version():
|
||||
with open("version.txt", "r") as version:
|
||||
thispath = os.path.dirname(os.path.realpath(__file__))
|
||||
with open(thispath + "/version.txt", "r") as version:
|
||||
return version.read()
|
||||
|
||||
def shell(self):
|
||||
pass
|
||||
def shell(self, cmd=""):
|
||||
line = "export PS1=\"r2env\\$ \";export PATH=\"" + self._r2env_path + "/bin:$PATH\"; $SHELL -f"
|
||||
if cmd.strip() == "":
|
||||
return os.system(line)
|
||||
return os.system(line + " -c '" + cmd + "'")
|
||||
|
||||
@staticmethod
|
||||
def _load_config():
|
||||
|
||||
+5
-2
@@ -29,12 +29,14 @@ def show_help():
|
||||
|
||||
|
||||
actions_with_argument = ["install", "uninstall", "use"]
|
||||
actions_with_arguments = ["shell"]
|
||||
actions = {
|
||||
"init": R2Env().init,
|
||||
"version": R2Env().get_r2_path,
|
||||
"config": R2Env().show_config,
|
||||
"list": R2Env().list_available_packages,
|
||||
"install": R2Env().install,
|
||||
"shell": R2Env().shell,
|
||||
"uninstall": R2Env().uninstall,
|
||||
"use": R2Env().use,
|
||||
"versions": R2Env().list_installed_packages,
|
||||
@@ -45,8 +47,9 @@ actions = {
|
||||
def run_action(action, args, use_meson):
|
||||
if action not in actions:
|
||||
print_console("[X] Action not found", ERROR)
|
||||
return
|
||||
if action in actions_with_argument:
|
||||
elif action in actions_with_arguments:
|
||||
actions[action](" ".join(args))
|
||||
elif action in actions_with_argument:
|
||||
exit_if_not_argument_is_set(args, action)
|
||||
if action == "install":
|
||||
actions[action](args[0], use_meson=use_meson)
|
||||
|
||||
Reference in new issue
Block a user