summaryrefslogtreecommitdiffstats
path: root/sploit/util/cmd.py
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2025-01-04 23:57:16 -0500
committerMalfurious <m@lfurio.us>2025-01-04 23:57:16 -0500
commit23c750d2edc712c4a37e0774049a1a0f9a966009 (patch)
treee16b9f6495776dccc2c8e39d29b66d28d94b3448 /sploit/util/cmd.py
parent640726aa11369d328c1cdfe00b4344b6a925729c (diff)
parent831fd7402cd357a79b76007471722a243ec60c8d (diff)
downloadnsploit-23c750d2edc712c4a37e0774049a1a0f9a966009.tar.gz
nsploit-23c750d2edc712c4a37e0774049a1a0f9a966009.zip
Merge branch 'nsploit'
Rename fork to nsploit and touch up project files. We switch from automatically obtaining version via git-describe to a static definition in pyproject.toml, to support more install use-cases. * nsploit: Update pyproject file for nsploit Don't rely on git for version information main: Update ASCII banner for nsploit Rename sploit package to nsploit
Diffstat (limited to 'sploit/util/cmd.py')
-rw-r--r--sploit/util/cmd.py26
1 files changed, 0 insertions, 26 deletions
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"