Finish writing about install.py
This commit is contained in:
parent
d39f597dd1
commit
b303345a82
1 changed files with 29 additions and 3 deletions
32
notes.md
32
notes.md
|
@ -3,7 +3,7 @@
|
||||||
* colorama -> dependency of cli-ui
|
* colorama -> dependency of cli-ui
|
||||||
* unidecode -> dependency of cli-ui
|
* unidecode -> dependency of cli-ui
|
||||||
* ruamel.yaml -> load and dump yaml with python
|
* 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`
|
# `bootstrap.sh`
|
||||||
* installs pip
|
* installs pip
|
||||||
|
@ -23,8 +23,7 @@
|
||||||
* Installer is a class, --force flag is passed to constructor
|
* Installer is a class, --force flag is passed to constructor
|
||||||
* runs Installer.install with the programs list
|
* runs Installer.install with the programs list
|
||||||
|
|
||||||
## class Installer()
|
## class Installer(force=False)
|
||||||
* force defaults to False
|
|
||||||
* self.conf -> load `configs.yml`
|
* self.conf -> load `configs.yml`
|
||||||
* self.this_dir = getcwd()
|
* self.this_dir = getcwd()
|
||||||
* self.home = ~ (expanduser)
|
* self.home = ~ (expanduser)
|
||||||
|
@ -33,3 +32,30 @@
|
||||||
- if no program in list, programs are found in self.conf
|
- if no program in list, programs are found in self.conf
|
||||||
- for each program, run install_program(program)
|
- for each program, run install_program(program)
|
||||||
* 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue