dotfiles/wscript

55 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-02-05 18:02:02 +00:00
#!/usr/bin/env python3
2016-02-07 16:39:18 +00:00
import json, os, shutil
2016-02-07 16:19:03 +00:00
DIR = os.getcwd()
2016-02-07 19:09:53 +00:00
def get_json(path):
return json.load(open(DIR + path))
2016-02-07 16:39:18 +00:00
def update_and_upgrade(ctx):
os.system('apt-get update -y')
os.system('apt-get upgrade -y')
os.system('apt-get dist-upgrade -y')
2016-02-07 16:19:03 +00:00
def apt_install_core(ctx):
2016-02-07 19:09:53 +00:00
for package in get_json('/apt/apt-installs-core.json'):
2016-02-07 16:39:18 +00:00
os.system("apt-get install {} -y".format(package))
2016-02-07 16:19:03 +00:00
def add_apt_keys(ctx):
2016-02-07 19:09:53 +00:00
for key in get_json('/apt/apt-keys.json'):
2016-02-07 16:39:18 +00:00
os.system("wget -O - {} | apt-key add -".format(key))
2016-02-07 16:19:03 +00:00
def add_apt_sources(ctx):
os.system('apt/add-apt-sources.sh')
def add_apt_repos(ctx):
2016-02-07 19:09:53 +00:00
for repo in get_json('/apt/apt-repos.json'):
2016-02-07 16:39:18 +00:00
os.system("add-apt-repository {} -y".format(repo))
2016-02-07 16:19:03 +00:00
def apt_install_extras(ctx):
2016-02-07 19:09:53 +00:00
for package in get_json('/apt/apt-installs-extra.json'):
2016-02-07 16:39:18 +00:00
os.system("apt-get install {} -y".format(package))
2016-02-07 16:19:03 +00:00
2016-02-07 17:13:23 +00:00
def run_custom_installs(ctx):
os.system('apt/custom-installs.sh')
2016-02-07 16:32:59 +00:00
def install_atom_packages(ctx):
2016-02-07 19:09:53 +00:00
packages = " ".join(get_json('/atom/packages.json'))
2016-02-07 16:32:59 +00:00
os.system("apm install {}".format(packages))
2016-02-05 18:02:02 +00:00
2016-02-07 16:39:18 +00:00
def install_configs(ctx):
shutil.copyfile(DIR + "/config/terminator.conf", "~/.config/terminator/config")
2016-02-07 17:13:23 +00:00
2016-02-05 18:02:02 +00:00
if __name__ == '__main__':
print("Please run this file using waf, not directly.")
exit(1)