-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·46 lines (41 loc) · 935 Bytes
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
echo "what will the grump be called?"
read grumpName
if [ -d "${grumpName}" ]; then
echo "there is a already a directory with that name"
exit 1
fi
echo "Briefly describe the grump's function"
read grumpDescription
echo "creating a folder called ${grumpName} for the grump"
mkdir -p ${grumpName} && cd $_;
echo "creating a grump.json"
cat >grump.json <<EOL
{
"defaultCommand": "${grumpName}",
"commands": {
"${grumpName}": {
"scriptType": "bash",
"scriptPath": "${grumpName}.sh",
"vars": {}
}
}
}
EOL
echo "creating a readme"
cat >README.md <<EOL
# ${grumpName}
${grumpDescription}
If grump has not yet been installed, you can do so using:
\`\`\`bash
npm i -g grump
\`\`\`
Example usage:
\`\`\`
grump ${grumpName}
\`\`\`
see [grumpJS.com](https://grumpjs.com) to find other useful grumps!
EOL
echo "creating ${grumpName} shell file"
echo "#!/bin/bash" > ${grumpName}.sh
git init