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