summaryrefslogtreecommitdiff
path: root/.config/vcsh/hooks-available/post-init
blob: 56f3f64f48a92bf4db6b1855eb1ec6a82674a815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

if [ -n "$VCSH_GITURL" ]; then
    vcsh "$VCSH_DIRECTORY" remote add origin "$VCSH_GITURL/$VCSH_DIRECTORY"
fi
if [ -n "$VCSH_GITHOST" ] && [ -n "$VCSH_GITHOST_DIRECTORY" ]; then
    remote_gitdir="$VCSH_GITHOST_DIRECTORY/$VCSH_DIRECTORY.git"
    command="git init --bare '$remote_gitdir'"
    if [ -n "$VCSH_GITHOST_DESCRIPTION" ]; then
        description="$(eval echo \"$VCSH_GITHOST_DESCRIPTION\")"
        command="$command && echo \"${description}\" > '$remote_gitdir/description'"
    fi
    ssh "$VCSH_GITHOST" "$command"
fi