mirror of
https://github.com/narkoz/hacker-scripts
synced 2025-08-23 19:07:33 +00:00
24 lines
486 B
Python
24 lines
486 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import pathlib
|
|
import subprocess
|
|
|
|
from dotenv import Dotenv
|
|
|
|
|
|
def get_dotenv(filename='.env'):
|
|
return Dotenv(str(pathlib.Path(__file__).parent / filename))
|
|
|
|
|
|
def sh(*args):
|
|
proc = subprocess.Popen(args, stdout=subprocess.PIPE)
|
|
stdout, _ = proc.communicate()
|
|
return stdout
|
|
|
|
|
|
def get_log_path(name):
|
|
path = pathlib.Path(__file__).parent / 'logs' / name
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
return path
|