From b303345a82e4277b850f31656d6b6c5ee81b86db Mon Sep 17 00:00:00 2001 From: "flyingscorpio@arch-desktop" Date: Sat, 18 Apr 2020 19:18:57 +0200 Subject: [PATCH] Finish writing about install.py --- notes.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/notes.md b/notes.md index c7449ae..49a7ef0 100644 --- a/notes.md +++ b/notes.md @@ -3,7 +3,7 @@ * colorama -> dependency of cli-ui * unidecode -> dependency of cli-ui * ruamel.yaml -> load and dump yaml with python -* path.py -> create path objects (alternative to os.path) +* path -> create path objects (alternative to os.path) # `bootstrap.sh` * installs pip @@ -23,8 +23,7 @@ * Installer is a class, --force flag is passed to constructor * runs Installer.install with the programs list -## class Installer() -* force defaults to False +## class Installer(force=False) * self.conf -> load `configs.yml` * self.this_dir = getcwd() * self.home = ~ (expanduser) @@ -33,3 +32,30 @@ - if no program in list, programs are found in self.conf - for each program, run install_program(program) * install_program(program) + - print program name + - look up program conf and assign to `todo` variable + - for each action in `todo`, call corresponding method +* do_clone(url, dest, branch='master'): + - create dirs for dest recursively + - use subprocess to issue git clone command +* do_copy(src, dest): + - create dirs for dest recursively + - copy a config file to dest +* do_download(*, url, dest, executable=False): + - create dirs for dest recursively + - fetch url to dest + - if it should be executable, chmod it to 755 +* do_run(args): + - args is a list + - from that list, create a command + - subprocess.check_call(command) +* do_symlink(src, dest): + - if is_dir make tree from parent.parent + - if not is_dir make tree from parent + - if dest is a link, remove it + - create the symlink +* do_write(src, contents): + - create path to src + - format the content with self.this_dir and self.home + - add newline at end + - write to file