Created
November 28, 2020 13:57
-
-
Save jack-jjm/5379eac4b75c61f7a4024362cdd16e93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
findOutput=$(find "/home/jack/Code Project Templates" -maxdepth 1 -type d -printf "|%P") | |
typeOptions=Empty${findOutput:1} | |
result=$(zenity --class Code --forms --title "New Project" --text="Create new project" --add-entry="Name" --add-combo="Type" --combo-values "$typeOptions") | |
if [[ "$result" ]] | |
then | |
name=$(echo $result | python3 -c "print(input().split('|')[0])") | |
type=$(echo $result | python3 -c "print(input().split('|')[1])") | |
if [[ -z "$name" ]] | |
then | |
echo "no entry" | |
exit 1 | |
fi | |
echo "Name: $name" | |
cd ~/Code | |
mkdir "$name" | |
cd "$name" | |
mkdir Codebase | |
cd Codebase | |
git init | |
if [[ "$type" = "Empty" ]] | |
then | |
type="" | |
fi | |
if [[ ! -z "$type" ]] | |
then | |
cp -r "/home/jack/Code Project Templates/$type/"* . | |
fi | |
code . & | |
else | |
echo "no entry" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment