create.sh (483B)
1 #!/bin/bash 2 3 if [ "$1" ]; then 4 5 #split FILE -b 100m 6 7 FILE=$(realpath "$1") 8 BASENAME=$(basename "$FILE") 9 10 NAME=$(head -c 32 /dev/urandom | sha256sum | awk '{print $1}') 11 12 cp "$FILE" /tmp/ 13 14 cd /tmp || exit 1 15 gh repo create "$NAME" --private --clone 16 17 mv "/tmp/$BASENAME" "/tmp/$NAME/" 18 cd "/tmp/$NAME" || exit 1 19 20 git add . 21 git commit -m "Init" 22 git push --set-upstream origin master 23 24 else 25 echo "Usage: $0 <file-to-upload>" 26 exit 1 27 fi