Untitled

From Gray Pintail, 4 Weeks ago, written in Plain Text, viewed 13 times.
URL http://pastebin.mattei.co/index.php/view/e8082a75 Embed
Download Paste or View Raw
  1.  #!/bin/sh -x
  2.  
  3.    repo_name=$1
  4.    repo_des=$2
  5.    repo_type=$3
  6.  
  7.    if [ $# -lt 2 ] ; then
  8.            echo "Usage: <repo-name> <repo-description>"
  9.            echo repo_type is true or false
  10.  
  11.        if [ $repo_type == yes ];  then
  12.  
  13.        mkdir $repo_name && cd $repo_name
  14.        touch README.adoc
  15.        printf "= $repo_des \n" >> README.adoc
  16.        git init
  17.        git config user.name "Remo Mattei"
  18.        git config user.email rm@rm.ht
  19.       curl -i -H 'Authorization: token 4144bae59b9c560d9d6daadf1x ' https://api.github.com/user/repos -d "{\"private\":\"$repo_type\",\"name\":\"$repo_name\",\"description\":\"$repo_des\"}"
  20.       git add README.adoc
  21.       git commit -m "First Commit"
  22.       git remote add origin git@github.com:itlinux/$repo_name
  23.       git push -u origin master
  24.       echo $repo_name has been created
  25.        fi
  26.  
  27.       if [ $repo_type == no ];  then
  28.  
  29.        mkdir $repo_name && cd $repo_name
  30.        touch README.adoc
  31.        printf "= $repo_des \n" >> README.adoc
  32.        git init
  33.        git config user.name "Remo Mattei"
  34.        git config user.email rm@rm.ht
  35.  
  36.        curl -i -H 'Authorization: token 4144bae59b9c560d9d6daadf1x ' https://api.github.com/user/repos -d "{\"name\":\"$repo_name\",\"description\":\"$repo_des\"}"
  37.        git add README.adoc
  38.        git commit -m "First Commit"
  39.        git remote add origin git@github.com:itlinux/$repo_name
  40.        git push -u origin master
  41.        echo $repo_name has been created
  42.       fi
  43.    fi

Reply to "Untitled"

Here you can reply to the paste above