bork

The Bash-Operated Reconciling Kludge


Project maintained by borksh Hosted on GitHub Pages — Theme by mattgraham

Assertion types

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.

apk

Removable

asserts presence of packages installed via apk (Alpine Package Manager)

Usage

* apk package-name    (install/upgrade given package)

apm

Removable

asserts the presence of an atom package

Usage

> apm docblockr

apt

Removable

asserts packages installed via apt-get on debian or ubuntu linux

Usage

* apt package-name

brew-tap

Removable

Asserts a homebrew formula repository has been tapped. Does NOT assert the updated-ness of a tap’s formula - use ok brew

Usage

> brew-tap homebrew/games    (taps homebrew/games)

brew

Inspectable Removable

asserts presence of packages installed via homebrew on mac os x

Usage

* brew                  (installs/updates homebrew)
* brew package-name     (installs package)
--from=caskroom/cask    (source repository)
--HEAD                  (install package at HEAD)

cask

Inspectable Removable

asserts presence of apps installed via Homebrew Casks on macOS

Usage

* cask app-name         (installs cask)
--appdir=/Applications  (changes symlink path)

check

Runs a given command. OK if returns 0, FAILED otherwise.

Syntax

check evalstr

Example

check "[ -d $HOME/.ssh/id_rsa ]"'
if check_failed; then ...'

defaults

Removable

asserts settings for macOS’s ‘defaults’ system

Usage

* defaults domain key type value
> defaults com.apple.dock autohide bool true

directory

Removable

asserts presence of a directory

Usage

* directory path [options]
--owner=user-name
--group=group-name
--mode=mode
> directory ~/.ssh --mode=700

dnf

Available since 0.14.0

asserts packages installed via dnf on CentOS or RedHat

Usage

* dnf package-name

download

assert the presence & comparisons of a file to a URL

Usage

> download ~/file.zip "http://example.com/file.zip"
--size                (compare size to Content-Length at URL)

file

Removable

asserts the presence, checksum, owner and permissions of a file. when removing, deletes the target file.

Usage

* file target-path source-path [arguments]
--permissions=755       permissions for the file
--owner=owner-name      owner name of the file

gem

Inspectable Removable

asserts the presence of a gem in the environment’s ruby

Usage

> gem bundler

git

Removable

asserts presence and state of a git repository

Usage

> 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)

github

Removable

front-end for git type, uses github urls

Usage

passes arguments to git type
> ok github borksh/bork
> ok github ~/code/bork borksh/bork
--ssh                    (clones via ssh instead of https)

go-get

asserts a go pkg is installed in $GOPATH

Usage

> go-get guru

group

Inspectable Removable

asserts presence of a user group

Usage

> group admin

iptables

asserts presence of iptables rule

Usage

NOTE: does not assert ordering of rules
> iptables INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

mas

Inspectable Removable

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.

Usage

> mas 497799835 Xcode    (installs/upgrades Xcode)

npm

Inspectable Removable

asserts the presence of a nodejs module in npm’s global installation

Usage

> npm grunt-cli

pip

Removable

asserts presence of packages installed via pip

Usage

> pip pygments
--sudo            (install with sudo)

pip3

Available since 0.12.0 Inspectable Removable

asserts presence of packages installed via pip3

Usage

> pip3 pygments
--sudo            (install with sudo)

pipsi

Removable

asserts presence of packages installed via pipsi

Usage

* pipsi                (install/upgrade pipsi itself)
* pipsi package-name   (works on given package from pypi)
--global               (work on global packages instead of per-user)

scutil

Verifies macOS machine name with scutil

Usage

> scutil ComputerName bork

shells

Available since 0.12.0 Removable

asserts presence of a shell in /etc/shells

Usage

> shells /usr/local/bin/zsh

assert presence and target of a symlink

Usage

> symlink .vimrc ~/code/dotfiles/configs/vimrc

user

Inspectable Removable

assert presence of a user on the system

Usage

> user admin
--shell=/bin/fish
--groups=admin,deploy
--real-name=Admin

yum

Removable

asserts packages installed via yum on CentOS or RedHat

Usage

* yum package-name

zypper

Removable

asserts presence of packages installed via zypper (SUSE)

Usage

* zypper package-name    (install/upgrade given package)