mirror of
https://github.com/hrfee/jellyfin-accounts.git
synced 2024-12-22 00:50:12 +00:00
add non interactive modes to build scripts
This commit is contained in:
parent
3d10a8fe06
commit
43c0631f9b
@ -1,8 +1,16 @@
|
||||
import subprocess
|
||||
import shutil
|
||||
import os
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
"-y", "--yes", help="use assumed node bin directory.", action="store_true"
|
||||
)
|
||||
|
||||
|
||||
def runcmd(cmd):
|
||||
if os.name == "nt":
|
||||
return subprocess.check_output(cmd, shell=True)
|
||||
@ -17,6 +25,9 @@ try:
|
||||
except:
|
||||
node_bin = Path(out.decode('utf-8').rstrip())
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.yes:
|
||||
print(f"assuming npm bin directory \"{node_bin}\". Is this correct?")
|
||||
if input("[yY/nN]: ").lower() == "n":
|
||||
node_bin = local_path.parent / 'node_modules' / '.bin'
|
||||
|
@ -3,8 +3,16 @@ import sass
|
||||
import subprocess
|
||||
import shutil
|
||||
import os
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
parser.add_argument(
|
||||
"-y", "--yes", help="use assumed node bin directory.", action="store_true"
|
||||
)
|
||||
|
||||
|
||||
def runcmd(cmd):
|
||||
if os.name == "nt":
|
||||
return subprocess.check_output(cmd, shell=True)
|
||||
@ -19,6 +27,9 @@ try:
|
||||
except:
|
||||
node_bin = Path(out.decode('utf-8').rstrip())
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.yes:
|
||||
print(f"assuming npm bin directory \"{node_bin}\". Is this correct?")
|
||||
if input("[yY/nN]: ").lower() == "n":
|
||||
node_bin = local_path.parent / 'node_modules' / '.bin'
|
||||
|
Loading…
Reference in New Issue
Block a user