#!/usr/bin/env rc fn usage { echo 'usage: sip-logs.rc REPO [JOB_ID]' >[1=2] exit 2 } if(! ~ $#* 1 2) usage scriptdir=`{dirname $0} root=`{cd $scriptdir^/..; pwd} repo=$1 if(test -x $root^/target/debug/sip) { $root^/target/debug/sip logs $* } else if(cargo --version >/dev/null >[2=1]) { cargo run --quiet --manifest-path $root^/Cargo.toml -- logs $* } else { nix shell 'nixpkgs#rustc' 'nixpkgs#cargo' -c cargo run --quiet --manifest-path $root^/Cargo.toml -- logs $* }