-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdeploy
More file actions
executable file
·34 lines (27 loc) · 799 Bytes
/
deploy
File metadata and controls
executable file
·34 lines (27 loc) · 799 Bytes
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
#!/bin/sh
# see if we can use zip
if ! hash zip 2>/dev/null; then
echo "This script requires the 'zip' command in your path. Hint: apt-get install zip" >&2
exit 1
fi
cd "`dirname $0`"
url="https://happening.im/plugin/${1-$(cat .deploykey)}"
if [ $? -ne 0 ]; then
echo "Either supply a deploy key as first argument or populate .deploykey"
exit 1
fi
tmp=.upload.zip
rm -f $tmp
zip -qr $tmp * -x@.deployignore
# see if we can use curl, otherwise try wget, else fail
if hash curl 2> /dev/null; then
curl --data-binary @$tmp ${url}
elif hash wget 2> /dev/null; then
wget --content-on-error --post-file=$tmp ${url} -O - -q
else
echo "This script requires either 'curl' or 'wget' in your path. Hint: apt-get install curl" >&2
rm -f $tmp
exit 1
fi
# remove the temporary zip file
rm -f $tmp