Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 2.97 KB

scripts.md

File metadata and controls

60 lines (49 loc) · 2.97 KB

Scripts

The helper scripts in bin/. Each one prints its usage with -h or --help and exits without doing anything else, so bin/<script> --help is the place to look for arguments and details. This page only says what each script is for. Most of them expect to be run from the top of the repository.

Setting up a machine

  • check-setup - Reports the tools this setup expects that are missing (Node.js and npm, and linters for Ansible and Docker when those are installed), with install hints. Installs nothing.
  • post-clone - Sets up a fresh clone: fetches the plugin submodules, then installs Node.js, the npm and pipx tools, and the system packages this setup uses. Uses sudo.

Managing plugin submodules

Plugins are git submodules. These scripts add, move and remove them, and commit the change.

  • addsubmodule - Adds plugin repositories as submodules in a package under .vim/pack/ (such as 100-core), one commit each. The package must already exist; a plugin already in .gitmodules is skipped.
  • mvsubmodule - Moves a submodule into a package under .vim/pack/.
  • rmsubmodule - Removes a submodule completely, including its copy under .git/modules (or a linked worktree's own copy).
  • set-submodule-branch - Records the remote's default branch for every submodule that has none set, checks that branch out, and commits .gitmodules with the submodule's new commit. A submodule it cannot reach or check out is reported and makes it fail.

Other

  • update-coc-extensions - Adds the CoC extensions installed on this machine to g:coc_global_extensions in .vimrc, and sorts the list by name. An extension already in the list stays even when it is not installed here, so taking one out is done by hand. It reads the installed ones from coc/extensions under $XDG_CONFIG_HOME, or under ~/.config when that is not a directory, as CoC does, unless COC_EXTENSIONS_DIR names another directory. It writes nothing when none are installed.

Testing

bats tests/shell runs the scripts' tests, including a check that each --help exits before doing any work. See the README for what the tests need.