#!/bin/bash die() { echo "$0: $*" >&2 exit 1 } logfile="$HOME"/.local/state/pickls/pickls.log mkdir -p "$(dirname "$logfile")" || die "failed to mkdir" # For local development, assuming you've cloned this into "$HOME"/src/pickls, do something like: # ln -s "$HOME"/src/pickls/pickls-debug-runner "$HOME"/.local/bin/pickls # And, make sure "$HOME"/.local/bin is in your PATH, etc... echo "$0: invoked! [pickls$(printf " '%s'" "$@")]" >>"$logfile" export RUST_BACKTRACE=1 on_exit() { echo "$0: exited!" >>"$logfile" } trap on_exit EXIT cargo run --quiet --manifest-path="$HOME"/src/pickls/Cargo.toml -- "$@" 2>>"$logfile"