diff --git a/INSTALL_ALL_THE_THINGS b/INSTALL_ALL_THE_THINGS deleted file mode 100755 index b1e280c..0000000 --- a/INSTALL_ALL_THE_THINGS +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python3 - -import time -from scripts.install_dotfiles import * - -EXEC_ORDER = [ - update, - apt_upgrade, - apt_install_core, - add_apt_keys, - add_apt_sources, - add_apt_repos, - update, - run_custom_installs, - update, - apt_install_extras, - source, - install_atom_packages, - export_atom_config, - install_configs -] - - -if __name__ == '__main__': - t0 = time.time() - for script in EXEC_ORDER: - script() - print("\n>> {} Exescuted.\n".format(script.__name__)) - t1 = time.time() - print("Execution Complete") - print("Took {} seconds.".format(int(t1 - t0))) diff --git a/apt/export.py b/apt/export.py new file mode 100644 index 0000000..65f9b0c --- /dev/null +++ b/apt/export.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +import json, os + +os.system('sudo apt-get update -y') +os.system('sudo apt-get upgrade -y') +os.system('sudo apt-get dist-upgrade -y') + + +packages = " ".join(json.load(open('apt-installs-core.json'))) +os.system("sudo apt-get install {} -y".format(packages)) + +for key in json.load(open('apt-keys.json')): + os.system("wget -O - {} | sudo apt-key add -".format(key)) + +os.system('sudo apt/add-apt-sources.sh') + +for repo in json.load(open('apt-repos.json')): + os.system("sudo add-apt-repository {} -y".format(repo)) + +os.system('sudo apt-get update -y') + +packages = " ".join(json.load(open('apt-installs-extra.json'))) +os.system("sudo apt-get install {} -y".format(packages)) + +os.system('apt/custom-installs.sh') diff --git a/atom/export.sh b/atom/export.sh new file mode 100644 index 0000000..059b485 --- /dev/null +++ b/atom/export.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +mkdir ~/.atom + +cp * ~/.atom diff --git a/bash/export.sh b/bash/export.sh new file mode 100644 index 0000000..475786e --- /dev/null +++ b/bash/export.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +cp .bash_aliases ~/ diff --git a/config/export.sh b/config/export.sh new file mode 100644 index 0000000..1322e82 --- /dev/null +++ b/config/export.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +cp terminator.conf ~/.config/terminator/config diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index d55ab56..0000000 --- a/scripts/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Scripts - -Custom Scripts - -Includes `install_dotfiles.py`, which installs this project diff --git a/scripts/__init__.py b/scripts/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/scripts/install_dotfiles.py b/scripts/install_dotfiles.py deleted file mode 100644 index 537dd92..0000000 --- a/scripts/install_dotfiles.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python3 -import json, os, shutil - - -DIR = os.getcwd() -HOME = os.path.expanduser('~') - - -def _get_json(path): - return json.load(open(DIR + path)) - - -def update(): - os.system('sudo apt-get update -y') - - -def apt_upgrade(): - os.system('sudo apt-get upgrade -y') - os.system('sudo apt-get dist-upgrade -y') - - -def apt_install_core(): - packages = " ".join(_get_json('/apt/apt-installs-core.json')) - os.system("sudo apt-get install {} -y".format(packages)) - - -def add_apt_keys(): - for key in _get_json('/apt/apt-keys.json'): - os.system("wget -O - {} | sudo apt-key add -".format(key)) - - -def add_apt_sources(): - os.system('sudo apt/add-apt-sources.sh') - - -def add_apt_repos(): - for repo in _get_json('/apt/apt-repos.json'): - os.system("sudo add-apt-repository {} -y".format(repo)) - - -def apt_install_extras(): - packages = " ".join(_get_json('/apt/apt-installs-extra.json')) - os.system("sudo apt-get install {} -y".format(packages)) - - -def run_custom_installs(): - os.system('apt/custom-installs.sh') - - -def install_atom_packages(): - packages = " ".join(_get_json('/atom/packages.json')) - os.system("apm install {}".format(packages)) - - -def export_atom_config(): - os.makedirs("~/.atom", exist_ok=True) - os.system("cp -R atom/* ~/.atom/") - - -def install_configs(): - os.makedirs("~/.config/terminator/", exist_ok=True) - shutil.copyfile(os.path.join(DIR, "config/terminator.conf"), os.path.expanduser("~/.config/terminator/config")) - shutil.copyfile(os.path.join(DIR, "bash/.bash_aliases"), os.path.expanduser("~/.bash_aliases")) - - -def source(): - os.system(". ~/.bashrc") - - -if __name__ == '__main__': - print("Please run this file using the install script, not directly.") - exit(1) diff --git a/scripts/runtests.sh b/scripts/runtests.sh index 13793d4..a47c64c 100755 --- a/scripts/runtests.sh +++ b/scripts/runtests.sh @@ -14,5 +14,7 @@ jsonlint -q atom/packages.json echo ">> Validating Python..." pip install flake8 -flake8 scripts/install_dotfiles.py --ignore=E128,E501,E401,F403 +flake8 atom/exports.py --ignore=E128,E501,E401,F403 +flake8 scripts/installers.py --ignore=E128,E501,E401,F403 +flake8 yaourt/exports.py --ignore=E128,E501,E401,F403 flake8 INSTALL_ALL_THE_THINGS --ignore=E128,E501,E401,F403