#!/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" git add appstore.config