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 (from heno72/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:

  1. xadfbase is set to existing xadfbase or the default location if not set with --xadf-seat, and xadfdir is set to be the same as xadfbase if it is not set already.
  2. xadfbase uses existing one from environment if already set, refuses to run if not set. If run, xadfdir is set to the default location unless specified otherwise with --seat flag.
  3. will not touch xadfbase, xadfdir, or even make xadfrc, just download the files to their proper locations.

Actually we can rearrange the install modes:

  1. Minimal install, only download required files (or checkout required files) and set up default xadfbase directory.
  2. Install xadf, also generates configuration files (xadfrc and recipe.txt), modify xadfbase and xadfdir. If xadfbase or xadfdir is already set via config or via arguments, uses the existing value.
  3. Custom install (or install dotfiles), requires that xadfrc is already been set up, as it needs the xadfbase directory. Since --custom-install is dependent on --clone-source/-s URL, why not just use it instead of having an additional --custom-install argument? When regenerating xadfrc, uses existing xadfbase and sets up xadfdir to default, unless specified.