summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/appstore-add-app33
-rwxr-xr-xbin/appstore-init6
2 files changed, 36 insertions, 3 deletions
diff --git a/bin/appstore-add-app b/bin/appstore-add-app
new file mode 100755
index 0000000..c190efb
--- /dev/null
+++ b/bin/appstore-add-app
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+set -e
+set -u
+
+APPSTORE_HOME=$(cd $(dirname "$0")/.. && pwd)
+
+. $APPSTORE_HOME/lib/common
+# HEADER END
+
+usage() {
+ echo "usage: $0 add-app [name] [resolver] [resolver args] [version] [state]"
+}
+
+if [ $# -ne 5 ]
+then
+ usage
+fi
+
+name="$1"
+
+# Creating configuration file for the application
+touch "$name".config
+git add "$name".config
+
+app conf set -f appstore.config ${name}.resolver "$2"
+app conf set -f appstore.config ${name}.resolver_args "$3"
+app conf set -f appstore.config ${name}.version "$4"
+app conf set -f appstore.config ${name}.state "$5"
+
+# Register the application
+apps=$(app cat-conf -f appstore.config -k appstore.apps | cut -f 2- -d =)
+app conf set -f appstore.config appstore.apps "$apps,$name"
diff --git a/bin/appstore-init b/bin/appstore-init
index 92f6ab6..029391c 100755
--- a/bin/appstore-init
+++ b/bin/appstore-init
@@ -9,7 +9,7 @@ APPSTORE_HOME=$(cd $(dirname "$0")/.. && pwd)
# HEADER END
usage() {
- echo "usage [server] [name]"
+ echo "usage [server] [remote path] [name]"
exit 1
}
@@ -37,8 +37,8 @@ ret=$?
set -e
sed -n "s,^config: \(.*\),\1,p" $tmpfile > $conffile
-repo_path=`app cat-conf -f "$conffile" -n repo.path | cut -f 2- -d =`
-repo_ok=`app cat-conf -f "$conffile" -n repo.ok | cut -f 2- -d =`
+repo_path=`app cat-conf -f "$conffile" -k repo.path | cut -f 2- -d =`
+repo_ok=`app cat-conf -f "$conffile" -k repo.ok | cut -f 2- -d =`
if [ "$ret" != 0 ]
then