re-add accidentally removed root check

This commit is contained in:
bridiver
2024-01-12 14:24:56 +07:00
committed by Aleksey Khoroshilov
parent bad2a89ba2
commit c8606b55f0
+12
View File
@@ -18,6 +18,8 @@ if sys.platform in ['win32', 'cygwin']:
def main():
args = parse_args()
if not args.yes and PLATFORM != 'win32':
check_root()
if args.verbose:
enable_verbose_mode()
@@ -28,8 +30,18 @@ def parse_args():
parser = argparse.ArgumentParser(description='Bootstrap this project')
parser.add_argument('-v', '--verbose', action='store_true',
help='Prints the output of the subprocesses')
parser.add_argument('-y', '--yes', '--assume-yes',
action='store_true',
help='Run non-interactively by assuming "yes" to all '
'prompts.')
return parser.parse_args()
def check_root():
if os.geteuid() == 0: # pylint: disable=no-member
print("We suggest not running this as root, unless you're really sure.")
choice = input("Do you want to continue? [y/N]: ")
if choice not in ('y', 'Y'):
sys.exit(0)
def update_node_modules(dirname, env=None):
if env is None: