0cbc3170
alichtman
#!/bin/sh
0cbc3170
alichtman
#
67d61192
alichtman
# Bash script to clone a repo, rename it and push it your own github
67d61192
alichtman
# profile WITHOUT crediting the original author.
0cbc3170
alichtman
0cbc3170
alichtman
#####
0cbc3170
alichtman
# User Input for github link and new repo name
0cbc3170
alichtman
#####
0cbc3170
alichtman
0cbc3170
alichtman
echo "Enter github link to a repo you want to steal:"
0cbc3170
alichtman
read -r github_url
0cbc3170
alichtman
echo "Enter a new name for the repo..."
0cbc3170
alichtman
read -r new_name
0cbc3170
alichtman
printf "\\nStealing: %s" "$github_url"
0cbc3170
alichtman
printf "\\nDisguising as: %s\\n\\n" "$new_name"
0cbc3170
alichtman
0cbc3170
alichtman
#####
f5fe373e
alichtman
# Clone project
0cbc3170
alichtman
#####
0cbc3170
alichtman
0cbc3170
alichtman
ext=".git"
0cbc3170
alichtman
github_url=$github_url$ext
0cbc3170
alichtman
git clone "$github_url" "$new_name"
0cbc3170
alichtman
cd "$new_name" || exit
f5fe373e
alichtman
f5fe373e
alichtman
#####
f5fe373e
alichtman
# "Clean" project
f5fe373e
alichtman
#####
f5fe373e
alichtman
0cbc3170
alichtman
rm -rf .git
0cbc3170
alichtman
f5fe373e
alichtman
if [[ -f license.* ]]; then
f5fe373e
alichtman
rm -i license.*
f5fe373e
alichtman
elif [[ -f LICENSE.* ]]; then
f5fe373e
alichtman
rm -i license.*
f5fe373e
alichtman
elif [[ -f License.* ]]; then
f5fe373e
alichtman
rm -i License.*
f5fe373e
alichtman
fi
f5fe373e
alichtman
0cbc3170
alichtman
#####
0cbc3170
alichtman
# Push "new" project to Github
0cbc3170
alichtman
#####
0cbc3170
alichtman
0cbc3170
alichtman
git init
0cbc3170
alichtman
git add .
0cbc3170
alichtman
git commit -m "A ton of hard work creating this totally original repo!"
0cbc3170
alichtman
printf "\\nOpen a new repository on github and enter the remote repo URL:\\n"
0cbc3170
alichtman
read -r remote_url
0cbc3170
alichtman
git remote add origin "$remote_url"
0cbc3170
alichtman
git remote -v
0cbc3170
alichtman
git push -u origin master
0cbc3170
alichtman
0cbc3170
alichtman
#####
0cbc3170
alichtman
# Celebrate your hard work!
0cbc3170
alichtman
#####
0cbc3170
alichtman
67d61192
alichtman
# ASCII art from: http://ascii.co.uk/art/champagne
67d61192
alichtman
# Is it ironic that I'm crediting my sources in a script satirizing the plagiarism of github repos?
67d61192
alichtman
0cbc3170
alichtman
printf "Have a drink or two! You deserve it!\\n"
7bcfa76e
alichtman
printf " * * []\\n _* *_ ||\\n |*| |*| ||\\n |_| |_| | |\\n \\*/ \\*/ |__|\\n | | | |\\n _|_ _|_ |__|\\n"