summaryrefslogtreecommitdiffhomepage
path: root/make-tar.sh
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-17 12:07:33 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-10-17 12:14:22 +0200
commit97b6c47b21f5d2bfb7a43969f67d6b3ad6edab28 (patch)
tree6a01342ce3dc1996f1cdf965ad3a189a44d35e63 /make-tar.sh
parent507ad23581797779f182adc116aae5556d2d2d78 (diff)
cmake: upload tarball to Dropbox but only if I'm the user
Diffstat (limited to 'make-tar.sh')
-rw-r--r--make-tar.sh15
1 files changed, 11 insertions, 4 deletions
diff --git a/make-tar.sh b/make-tar.sh
index 8954a4ba..e831f16a 100644
--- a/make-tar.sh
+++ b/make-tar.sh
@@ -2,16 +2,23 @@
prefix="$1"
filename="$2"
+bin="$3"
-rm -fv "$filename"
+cmake --build "$bin" --target install || exit 1
if : &&
cd $(dirname -- "${prefix}") &&
zip -9r "${filename}" $(basename "${prefix}")
then
- ls -lh -- "${filename}"
- case "$(uname -s)" in
- CYGWIN_*) ls -lh -- "$(cygpath -w -- "$filename")";;
+ case "$USER,$(uname -s)" in
+ # for the script see https://github.com/andreafabrizi/Dropbox-Uploader
+ sthalik,CYGWIN_*)
+ dropbox_uploader.sh -p upload "$filename" / &&
+ l="$(dropbox_uploader.sh share "/$filename")" &&
+ f="$(echo "$l" | tr -d '\n\r' | egrep -o 'https://[^ ]+$')" &&
+ test -n "$f" && { echo "$f"; echo -n "$f" | putclip; }
+ echo -ne '\a' ;;
+ *) ls -lh -- "${filename}" ;;
esac
else
rm -fv -- "${filename}"