scripts: add script_init mod
This commit is contained in:
parent
5522ffb169
commit
64d7434f59
3 changed files with 6 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
4
scripts/script_init.py
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env python3
|
||||
import sys
|
||||
from pathlib import PurePath
|
||||
sys.path[0] = str(PurePath(*PurePath(__file__).parts[:-2]))
|
||||
Loading…
Add table
Add a link
Reference in a new issue