mirror of https://github.com/hrfee/jfa-go
parent
5329f02768
commit
8a8fe65192
@ -1,17 +1,26 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
def runcmd(cmd):
|
def runcmd(cmd):
|
||||||
|
if os.name == "nt":
|
||||||
|
return subprocess.check_output(cmd, shell=True)
|
||||||
proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
|
proc = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE)
|
||||||
return proc.communicate()
|
return proc.communicate()
|
||||||
|
|
||||||
|
|
||||||
print('Installing npm packages')
|
print('Installing npm packages')
|
||||||
|
|
||||||
root_path = Path(__file__).parents[1]
|
root_path = Path(__file__).parents[1]
|
||||||
runcmd(f'npm install --prefix {root_path}')
|
if os.name == 'nt':
|
||||||
|
root_path /= 'node_modules'
|
||||||
|
|
||||||
if (root_path / 'node_modules' / 'cleancss').exists():
|
runcmd('npm install')
|
||||||
|
|
||||||
|
if (root_path / 'node_modules' / 'cleancss').exists() or (root_path / 'cleancss').exists():
|
||||||
print(f'Installed successfully in {str((root_path / "node_modules").resolve())}.')
|
print(f'Installed successfully in {str((root_path / "node_modules").resolve())}.')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in new issue