git.jamzattack.xyz

Scripts for working with stagit
git clone https://git.jamzattack.xyz/git.jamzattack.xyz
Log | Files | Refs

git-init (596B)


      1 #!/bin/sh
      2 
      3 if [ -d "$1.git" ]; then
      4     printf '%s already exists' "$1.git"
      5     exit 2
      6 fi
      7 
      8 # Create a bare repository
      9 mkdir "$1.git"
     10 cd "$1.git"
     11 git init --bare
     12 
     13 if [ "$USER" = "git" ];  then
     14     # Add post-recieve hook
     15     printf '#!/bin/sh\n/var/www/git/create.sh "%s"' "$1" > hooks/post-receive
     16     chmod +x hooks/post-receive
     17 
     18     # Add owner and url
     19     printf 'https://git.jamzattack.xyz/%s.git\n' "$1" > url
     20     printf 'jdb' > owner
     21 
     22     # Remove boilerplate description
     23     printf '' > description
     24 fi
     25 
     26 # (copy-file (buffer-file-name) "/ssh:root@jamzattack.xyz:/usr/local/bin/git-init" t)