-
Notifications
You must be signed in to change notification settings - Fork 4
/
MakePlugin.sh
executable file
·52 lines (41 loc) · 1.21 KB
/
MakePlugin.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
46
47
48
49
50
51
52
#!/bin/bash
# Author: Jed Carty April 13 2020 (@inmysocks on GitHub.com)
#
# This script creates an empty plugin in the Plugins folder
#
# Usage: ./MakePlugin.sh PluginName AuthorName
if [ ! -f ./Author.txt ]; then
echo "Run Setup.sh before running this."
exit 0
fi
AUTHOR=$(<./Author.txt)
PLUGINNAME="DemoPlugin"
PLUGINFOLDER=$(<PluginFolder.txt)
if [ "$1" ]; then
PLUGINNAME=$1
fi
if [ "$2" ]; then
AUTHOR=$2
fi
if [ -d "$PLUGINFOLDER/$AUTHOR" ]; then
mkdir "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME"
else
mkdir "$PLUGINFOLDER/$AUTHOR"
mkdir "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME"
fi
echo "{
\"title\": \"\$:/plugins/$AUTHOR/$PLUGINNAME\",
\"description\": \"A plugin description goes here\",
\"author\": \"$AUTHOR\",
\"version\": \"0.0.1\",
\"core-version\": \">=5.1.13\",
\"source\": \"\",
\"list\": \"readme\",
\"plugin-type\": \"plugin\"
}" > "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME/plugin.info"
echo "title: \$:/plugins/$AUTHOR/$PLUGINNAME/readme
caption: readme
Readme text goes here." > "$PLUGINFOLDER/$AUTHOR/$PLUGINNAME/readme.tid"
echo "New empty plugin created in $PLUGINFOLDER/$AUTHOR/$PLUGINNAME."
./MakeWiki.sh "$AUTHOR/$PLUGINNAME" server
./AddPlugin.sh "$AUTHOR/$PLUGINNAME" "$AUTHOR/$PLUGINNAME"