GITv
master
fake-ssh12 lines, 611 bytes
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh
# Stands in for ssh when trying GITv locally: hands git's command to `gitv serve` as the key of
# the owner named in the URL's user part. Use it with GIT_SSH_VARIANT=simple, which makes git
# run: fake-ssh <owner>@<host> '<git command>'.
#
#   GIT_SSH_VARIANT=simple GIT_SSH_COMMAND=scripts/fake-ssh git push um9i@local:um9i/demo.git main
#
# Repositories go to $GITV_REPOS, or dev/repos in this checkout.
set -eu
root=$(cd "$(dirname "$0")/.." && pwd)
owner=${1%%@*}
SSH_ORIGINAL_COMMAND=$2 GITV_REPOS=${GITV_REPOS:-$root/dev/repos} exec "${CARGO_TARGET_DIR:-$root/target}/debug/gitv" serve "$owner"