The Bash-Operated Reconciling Kludge
Here is an index of Bork assertion types and documentation on how to use them. If you are adding a type to Bork, please ensure you document it by creating a file in docs/_types
.
asserts presence of packages installed via apk (Alpine Package Manager)
* apk package-name (install/upgrade given package)
asserts the presence of an atom package
> apm docblockr
asserts packages installed via apt-get on debian or ubuntu linux
* apt package-name
Asserts a homebrew formula repository has been tapped. Does NOT assert the updated-ness of a tap’s formula - use ok brew
> brew-tap homebrew/games (taps homebrew/games)
asserts presence of packages installed via homebrew on mac os x
* brew (installs/updates homebrew)
* brew package-name (installs package)
--from=caskroom/cask (source repository)
--HEAD (install package at HEAD)
asserts presence of apps installed via Homebrew Casks on macOS
* cask app-name (installs cask)
--appdir=/Applications (changes symlink path)
Runs a given command. OK if returns 0, FAILED otherwise.
check evalstr
check "[ -d $HOME/.ssh/id_rsa ]"'
if check_failed; then ...'
asserts settings for macOS’s ‘defaults’ system
* defaults domain key type value
> defaults com.apple.dock autohide bool true
asserts presence of a directory
* directory path [options]
--owner=user-name
--group=group-name
--mode=mode
> directory ~/.ssh --mode=700
asserts packages installed via dnf on CentOS or RedHat
* dnf package-name
assert the presence & comparisons of a file to a URL
> download ~/file.zip "http://example.com/file.zip"
--size (compare size to Content-Length at URL)
asserts the presence, checksum, owner and permissions of a file. when removing, deletes the target file.
* file target-path source-path [arguments]
--permissions=755 permissions for the file
--owner=owner-name owner name of the file
asserts the presence of a gem in the environment’s ruby
> gem bundler
asserts presence and state of a git repository
> git git@github.com:borksh/bork
> git ~/code/bork git@github.com:borksh/bork
--branch=gh-pages (specify branch, tag, or ref)
--untracked-files=normal (specify what to do with untracked files. default is to ignore)
front-end for git type, uses github urls
passes arguments to git type
> ok github borksh/bork
> ok github ~/code/bork borksh/bork
--ssh (clones via ssh instead of https)
asserts a go pkg is installed in $GOPATH
> go-get guru
asserts presence of a user group
> group admin
asserts presence of iptables rule
NOTE: does not assert ordering of rules
> iptables INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
asserts a Mac app is installed and up-to-date from the App Store via the mas
utility. App ID is required and can be obtained from the mas list
command; name is optional.
> mas 497799835 Xcode (installs/upgrades Xcode)
asserts the presence of a nodejs module in npm’s global installation
> npm grunt-cli
asserts presence of packages installed via pip
> pip pygments
--sudo (install with sudo)
asserts presence of packages installed via pip3
> pip3 pygments
--sudo (install with sudo)
asserts presence of packages installed via pipsi
* pipsi (install/upgrade pipsi itself)
* pipsi package-name (works on given package from pypi)
--global (work on global packages instead of per-user)
Verifies macOS machine name with scutil
> scutil ComputerName bork
asserts presence of a shell in /etc/shells
> shells /usr/local/bin/zsh
assert presence and target of a symlink
> symlink .vimrc ~/code/dotfiles/configs/vimrc
assert presence of a user on the system
> user admin
--shell=/bin/fish
--groups=admin,deploy
--real-name=Admin
asserts packages installed via yum on CentOS or RedHat
* yum package-name
asserts presence of packages installed via zypper (SUSE)
* zypper package-name (install/upgrade given package)