Handle xadf-core installation and dotfiles installation
Since we plan to separate xadf-core installation from dotfiles replication, we have to consider to differentiate the install flow. I was thinking of --clone-source/-s URL option, that maybe should change the install mode if specified.
Here's the current install mode:
-
0: not an install mode -
1: default install (fromheno72/xadf) -
2: custom install -
3: minimal install
Note that since we already have install mode 2, we can assume that when passing --clone-source/-s URL, --custom-install is implied. This results in only a minimal change to the actual xadf code. Because then default install is the installation that installs directly from heno72/xadf repo (or any xadf specific repo at later date), and any custom install will always focus on installing a separate dotfiles repository.
It also simplifies --minimal-install, as it would only mean pulling default install but from a base branch instead of main branch. The base branch can contain only a minimal set of required xadf files, while main branch contains helper tools such as xadfcommit and a bunch of plugins.
It also solves the xadfbase vs xadfdir dilemma, since for install mode:
-
xadfbaseis set to existingxadfbaseor the default location if not set with--xadf-seat, andxadfdiris set to be the same asxadfbaseif it is not set already. -
xadfbaseuses existing one from environment if already set, refuses to run if not set. If run,xadfdiris set to the default location unless specified otherwise with--seatflag. - will not touch
xadfbase,xadfdir, or even makexadfrc, just download the files to their proper locations.
Actually we can rearrange the install modes:
- Minimal install, only download required files (or checkout required files) and set up default
xadfbasedirectory. - Install xadf, also generates configuration files (
xadfrcandrecipe.txt), modifyxadfbaseandxadfdir. Ifxadfbaseorxadfdiris already set via config or via arguments, uses the existing value. - Custom install (or install dotfiles), requires that
xadfrcis already been set up, as it needs thexadfbasedirectory. Since--custom-installis dependent on--clone-source/-s URL, why not just use it instead of having an additional--custom-installargument? When regeneratingxadfrc, uses existingxadfbaseand sets upxadfdirto default, unless specified.