scripts: add script_init mod

This commit is contained in:
The MMGen Project 2023-12-12 10:19:50 +00:00
commit 64d7434f59
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 6 additions and 2 deletions

View file

@ -1,9 +1,8 @@
#!/usr/bin/env python3
import sys,os
repo_root = os.path.split(os.path.abspath(os.path.dirname(sys.argv[0])))[0]
sys.path = [repo_root] + sys.path
import script_init
from mmgen.cfg import Config
from mmgen.util import msg,Msg,make_chksum_6
from mmgen.fileutil import get_lines_from_file

View file

@ -24,6 +24,7 @@ import sys,json,re
from subprocess import run,PIPE
from collections import namedtuple
import script_init
from mmgen.cfg import Config
from mmgen.util import Msg,msg,rmsg,ymsg,die

4
scripts/script_init.py Executable file
View file

@ -0,0 +1,4 @@
#!/usr/bin/env python3
import sys
from pathlib import PurePath
sys.path[0] = str(PurePath(*PurePath(__file__).parts[:-2]))