I really, really, really hate Bash scripting, and fiddling with my dot
files has always been a tad frustrating for me. I also use both Linux
and OSX, and while it’d be nice to have one set of Bash configuration
files for both, it’s not entirely possible without extra checks. For
example, if I want an alias for ls
to always show coloured output,
it’s -G
in OSX (i.e. the ancient FreeBSD userland that Apple still
supplies us with) but --color
in linux.
The aim is to totally avoid ANY conditional logic or ‘smarts’ in the bash files, meaning that colour/platform detection etc happen here. This is mainly because a) I loathe shell scripting and b) I loathe shell scripting and c) to ensure that I get as close to identical environments when I move between machines. I also want to be able to specify what an application needs, and have this script decide where the various bits of configuration go, because I can never bloody remember.
- .profile
- Put one-time setup (i.e. login) stuff here (environment variables, paths etc) - things that will be used by all applications. This is what Bash reads with a login shell.
- .bashrc
- Put things that need to be set for each (non-login) shell here.
- .aliases
- collection of Bash aliases, referenced by .bashrc.
- [X] Sanity check.
- [X] First, just output the aliases file.
- [X] Move config array out into a separate file.
- [X] Paths.
- [X] Get writing output.
- [X] Add prompt support.
- [X] Move all config (i.e. os specific options) into config, along with config helper functions.
- [X] prompt to replace working files
- [X] Test functions.
- [X] Make less ‘scripty’ - i.e. move most things into functions.
- [X] Write if test failed to stderr, but continue with rest of entries.
- [X] Support to just dump raw code into :bashrc
- [ ] Error on alias collisions.
- [ ] Path and Manpath should be grouped together (by app).
- [ ] Add support for :installation config.
- [X] Look into Jannet as a replacement language.
- [ ] Rewrite in Jannet? Actually maybe Babashka.....