marelle /

Filename Size Date modified Message
1.5 KB
3.5 KB

Marelle ("hopscotch")

Test-driven system administration in SWI-Prolog, in the style of Babushka.

Current status

Deliciously pre-alpha.

Hopscotch for Seniors

Installing marelle

1. Get prolog

On OS X, with homebrew

# install prolog
brew install swi-prolog

On Ubuntu

# install prolog
sudo apt-get install swi-prolog

2. Clone the repo

# clone the repo
mkdir -p ~/.local
git clone ~/.local/marelle

# set up an executable
cat >~/.local/bin/marelle <<EOF
exec swipl -q -t main -s ~/.local/marelle/ "$@"
chmod a+x ~/.local/bin/marelle

Writing deps

Make a marelle-deps/ folder inside your project repo. Each package has two components, a detect/2 goal and an install/2 goal, which can be written independently.

For example, suppose I want Python installed on OS X with Homebrew. I might write a dep:

detect(python, osx) :- exists_file('/usr/local/bin/python').
install(python, osx) :- shell('brew install python').

Running deps

See what's installed

This runs every detect/2 statement that's valid for your platform.

marelle installed

Install something

This will run the install/2 clause for your package, provided a valid one exists for your current platform.

marelle install python