summaryrefslogtreecommitdiff
path: root/git-mkremote
blob: 168f1425937c98de4f1537cf9b392d5ab5ea86bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# Copyright (C) 2024 dwlr <dweller@cabin.digital>
#
# BSD 3-Clause License (BSD-3-Clause)
# See LICENSE for details

set -e


if [ $# -lt 3 ]; then
    echo "Usage: $0 <name> <server> <repo name> [description]"
    exit 1;
fi

name=$1
serv=$2
repo=$3
shift 3

remote=$(ssh "$serv" mkrepo "$repo" "$@")
git remote add "$name" "$serv$remote"