summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/adobe-air-sdk-bin/files/airstart')
-rw-r--r--dev-util/adobe-air-sdk-bin/files/airstart34
1 files changed, 34 insertions, 0 deletions
diff --git a/dev-util/adobe-air-sdk-bin/files/airstart b/dev-util/adobe-air-sdk-bin/files/airstart
new file mode 100644
index 0000000..db76d6c
--- /dev/null
+++ b/dev-util/adobe-air-sdk-bin/files/airstart
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+synopsis() {
+ echo "Synopsis: $0 appl.air" >&2
+ exit 1
+}
+
+[ -z "$1" ] && synopsis
+
+tmpdir="$(mktemp -d /tmp/adobeair.XXXXXXXXXX)"
+
+cleanup() {
+ rm -rf "${tmpdir}"
+}
+
+runair() {
+ if [ ! -f "$1" ]; then
+ echo 'Specified application file not found:' "$1" >&2
+ cleanup
+ synopsis
+ return 1
+ fi
+
+ if ! unzip -q "$1" -d "${tmpdir}"; then
+ echo 'Unable to extract AIR application:' "$1" >&2
+ return 1
+ fi
+
+ /opt/bin/adl -nodebug "${tmpdir}"/META-INF/AIR/application.xml "${tmpdir}"
+}
+
+trap cleanup HUP INT QUIT TERM
+runair "$1"
+cleanup