tvl-depot/tools/gerrit-cli.nix
Luke Granger-Brown 68779da596 fix(gerrit-cli): don't output the path to SSH if it's on the path
Change-Id: Ic5ef3e9ae7984cc6c84ef99553bc94a7d44c3929
Reviewed-on: https://cl.tvl.fyi/c/depot/+/551
Reviewed-by: tazjin <mail@tazj.in>
2020-06-21 23:49:30 +00:00

13 lines
385 B
Nix

# Utility script to run a gerrit command on the depot host via ssh.
# Reads the username from TVL_USERNAME, or defaults to $(whoami)
{ pkgs, ... }:
pkgs.writeShellScriptBin "gerrit" ''
TVL_USERNAME=''${TVL_USERNAME:-$(whoami)}
if which ssh &>/dev/null; then
ssh=ssh
else
ssh="${pkgs.openssh}/bin/ssh"
fi
exec $ssh $TVL_USERNAME@code.tvl.fyi -p 29418 -- gerrit $@
''