tangled-on-commit#
Run a shell command whenever a specific repo gets a commit
$ tangled-on-commit @vielle.dev/tangled-on-commit ./commit.sh
Created for linux. Should work fine on MacOS. Will not work on windows.
Note: The shell command is placed inside/bin/sh -c "COMMAND", so make sure to escape quotes and backslashes. I reccomend executing a shell file and piping stdout and stderr to a log file
Installation#
Prerequisites:
GitRust(1.88+)CargoOpenSSL(required for ssl connection)pkg-config(required for ssl connection)
- Clone this repo:
git clone git@tangled.sh:vielle.dev/tangled-on-commit - Compile the binary:
cargo build --release - Copy the binary to your path:
sudo cp ./target/release/tangled-on-commit /bin
Usage#
CLI Arguments#
-
tangled-on-commit (-h | --help)
Displays this message -
tangled-on-commit
No specified handle, repo, or command. Falls back to config/env -
tangled-on-commit SHELL
Uses config/env for handle and repo -
tangled-on-commit @HANDLE SHELL
Uses config/env for repo -
tangled-on-commit REPO SHELL
Uses config/env for handle -
tangled-on-commit @HANDLE/REPO SHELL
tangled-on-commit HANDLE REPO SHELL
No config/env
JSON#
Loads the file tangled-on-commit.json from cwd if it exists.
Reads keys "handle", "repo_name", and "shell".
Unknown keys are ignored and any key can be ommitted
JSON is used if the arguments aren't passed to the CLI
Env#
Loads the environment variables TANGLED_ON_COMMIT_HANDLE and TANGLED_ON_COMMIT_REPO_NAME
Shell cannot be set by environment variables.
Env variables are used if relevant keys are ommitted an arguments aren't passed to the CLI.