aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-06-19 18:49:00 +0300
committerValentin Popov <info@valentineus.link>2018-06-19 18:49:00 +0300
commit3fa97bad312f24b815eac5b374e321512bc6aa4a (patch)
tree74c72fc6b069e51ede0368b71317567a6163aeec /build.sh
parentbdaf1d35b2b87394ec7c5974e48b7d48d852d0c5 (diff)
downloadlocal_webhooks-3fa97bad312f24b815eac5b374e321512bc6aa4a.tar.xz
local_webhooks-3fa97bad312f24b815eac5b374e321512bc6aa4a.zip
Fix error install.xml
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh29
1 files changed, 20 insertions, 9 deletions
diff --git a/build.sh b/build.sh
index 03105d6..b524be4 100644
--- a/build.sh
+++ b/build.sh
@@ -1,21 +1,32 @@
#!/bin/sh
# Author: Valentin Popov
# Email: info@valentineus.link
-# Date: 2017-10-19
-# Usage: /bin/sh build.sh
+# Date: 2018-06-19
+# Usage: /bin/sh ./build.sh
# Description: Build the final package for installation in Moodle.
# Updating the Environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
export PATH="$PATH:/usr/local/scripts"
-# Build the package
-cd ..
-mv "./moodle-webhooks" "./local_webhooks"
-zip -9 -r "local_webhooks.zip" "local_webhooks" \
- -x "local_webhooks/.git*" \
- -x "local_webhooks/.travis.yml" \
- -x "local_webhooks/build.sh"
+# Current project
+PROJECT="local_webhooks"
+
+# Defining directories
+DIRECTORY="$(pwd)"
+NAMEDIR="$(basename $DIRECTORY)"
+TMPDIR="$(mktemp --directory)"
+
+# Creating a Temporary Directory
+cp --recursive --verbose "../$NAMEDIR" "$TMPDIR/$PROJECT"
+mkdir --parents --verbose "$DIRECTORY/build"
+cd "$TMPDIR"
+
+# Creating an archive
+zip -9 -r "$DIRECTORY/build/$PROJECT.zip" "$PROJECT" \
+ -x "$PROJECT/.git*" \
+ -x "$PROJECT/.travis.yml" \
+ -x "$PROJECT/build*"
# End of work
exit 0 \ No newline at end of file