summaryrefslogtreecommitdiffstats
path: root/sploit/util
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--nsploit/util/__init__.py (renamed from sploit/util/__init__.py)0
-rw-r--r--nsploit/util/log.py (renamed from sploit/util/log.py)0
-rw-r--r--sploit/util/cmd.py26
3 files changed, 0 insertions, 26 deletions
diff --git a/sploit/util/__init__.py b/nsploit/util/__init__.py
index 32a079b..32a079b 100644
--- a/sploit/util/__init__.py
+++ b/nsploit/util/__init__.py
diff --git a/sploit/util/log.py b/nsploit/util/log.py
index 823b252..823b252 100644
--- a/sploit/util/log.py
+++ b/nsploit/util/log.py
diff --git a/sploit/util/cmd.py b/sploit/util/cmd.py
deleted file mode 100644
index 3a2b842..0000000
--- a/sploit/util/cmd.py
+++ /dev/null
@@ -1,26 +0,0 @@
-from os import path
-from subprocess import run
-
-def run_cmd(cmd,cwd=None):
- return run(cmd,cwd=cwd,capture_output=True,text=True,check=True).stdout.split('\n')[:-1]
-
-__RUN_CACHE__ = {}
-def run_cmd_cached(cmd,cwd=None):
- key = ''.join(cmd)
- if key in __RUN_CACHE__:
- return __RUN_CACHE__[key]
- else:
- result = run_cmd(cmd,cwd)
- __RUN_CACHE__[key] = result
- return result
-
-#try to get the version through git
-def git_version():
- try:
- cwd = path.dirname(path.realpath(__file__))
- version = run_cmd(["git","describe","--always","--first-parent","--dirty"],cwd=cwd)[0]
- #PEP440 compliance
- version = version.replace('-','+',1).replace('-','.')
- return version
- except:
- return "0+unknown.version"