summaryrefslogtreecommitdiffstats
path: root/nsploit/util/cmd.py
blob: 0a1333bc8145cda2e6a3c0ea38944d298eb3e189 (plain) (blame)
1
2
3
4
5
6
7
8
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]

def run_cmd_cached(cmd,cwd=None):
    result = run_cmd(cmd,cwd)
    return result