Fix install
This commit is contained in:
parent
633199826e
commit
cc7597aa3e
4 changed files with 23 additions and 16 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
__pycache__/
|
|
@ -2,24 +2,28 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
from scripts.install_dotfiles import *
|
||||||
|
|
||||||
|
EXEC_ORDER = [
|
||||||
|
update,
|
||||||
|
apt_upgrade,
|
||||||
|
apt_install_core,
|
||||||
|
add_apt_keys,
|
||||||
|
add_apt_sources,
|
||||||
|
add_apt_repos,
|
||||||
|
update,
|
||||||
|
apt_install_extra,
|
||||||
|
run_custom_installs,
|
||||||
|
install_atom_packages,
|
||||||
|
export_atom_config,
|
||||||
|
install_configs
|
||||||
|
]
|
||||||
|
|
||||||
def get_functions():
|
|
||||||
ns = {}
|
|
||||||
fn = os.path.join(os.path.dirname(__file__), 'wscript')
|
|
||||||
with open(fn) as f:
|
|
||||||
code = compile(f.read(), fn, 'exec')
|
|
||||||
eval(code, ns, ns)
|
|
||||||
return ns
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if os.geteuid() != 0:
|
if os.geteuid() != 0:
|
||||||
print("Please run as root!")
|
print("Please run as root!")
|
||||||
elif input("Are you sure you want to install (allthethings)? [Y/N]: ").lower() == 'y':
|
elif input("Are you sure you want to install (allthethings)? [Y/N]: ").lower() == 'y':
|
||||||
scripts = []
|
for script in EXEC_ORDER:
|
||||||
for key, func in get_functions().items():
|
script()
|
||||||
if type(func).__name__ == 'function' and func.__name__[0] != '_':
|
print("\n>>{} Executed.\n".format(script.__name__))
|
||||||
scripts.append(func)
|
|
||||||
|
|
||||||
for func in scripts:
|
|
||||||
func()
|
|
||||||
|
|
0
scripts/__init__.py
Normal file
0
scripts/__init__.py
Normal file
|
@ -7,9 +7,11 @@ DIR = os.getcwd()
|
||||||
def _get_json(path):
|
def _get_json(path):
|
||||||
return json.load(open(DIR + path))
|
return json.load(open(DIR + path))
|
||||||
|
|
||||||
|
def update():
|
||||||
def update_and_upgrade():
|
|
||||||
os.system('apt-get update -y')
|
os.system('apt-get update -y')
|
||||||
|
|
||||||
|
|
||||||
|
def apt_upgrade():
|
||||||
os.system('apt-get upgrade -y')
|
os.system('apt-get upgrade -y')
|
||||||
os.system('apt-get dist-upgrade -y')
|
os.system('apt-get dist-upgrade -y')
|
||||||
|
|
Loading…
Reference in a new issue