Verified Commit c1f8dc03 authored by AtjonTV's avatar AtjonTV
Browse files

xApp v1.1

parent 84fc295f
......@@ -4,17 +4,17 @@ Created by: Thomas Obernosterer
Created for: ATVG-Studios
License: [OSPL20](https://atvg-studios.com/ospl/ospl20) (MPL Like)
## Set Generator
## Set Generator (REQUIRED)
Command:
```
set_generator <name>
set_generator <name> <flags>
```
Example:
```
set_generator buffalo
set_generator buffalo --flag=no-git
```
## Generate new Project
......@@ -115,7 +115,7 @@ del_project cookies
```
## End Generator
## End Generator (REQUIRED)
Command:
```
......
#!/bin/bash
echo "[xApp] (Go Buffalo) Generation Language v1.0 by ATVG-Studios"
echo "[xApp] (Go Buffalo) Generation Language v1.1 by ATVG-Studios"
SCRIPT=""
FLAGS=""
APP=""
ARGS=""
ACTION_ARGS=""
......@@ -25,6 +27,22 @@ function _buffalo_new() {
fi
}
function _contains() {
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]] && return 0 || return 1
}
function _git_commit() {
_contains "$FLAGS" "--flag=no-git" && return
command -v git >/dev/null 2>&1 || { echo "Cannot find git! Please install Git or use 'set_generator <name> --flag=no-git'"; exit 1; }
cd $APP
echo "[xApp] Commiting to Git (disable by adding '--flag=no-git' to 'set_generator <name')"
git add -A;
git commit -m "xApp: Finished automated generation";
}
function generator() {
echo "[xApp] Running $GENERATOR"
echo ">> $@"
......@@ -48,10 +66,20 @@ function set_generator() {
ARGS="--skip-templates"
ACTION_ARGS="--skip-template"
fi
for flag in "${@:2}"; do
FLAGS="$FLAGS $flag"
done
}
function end_generator() {
git commit -m "xApp: Finished automated generation"
echo "[xApp] Generation Script '$SCRIPT' ended."
cd ..
echo "[xApp] Copying '$SCRIPT' to '$APP'"
cp $SCRIPT $APP
_git_commit
}
function gen_project() {
......@@ -102,12 +130,13 @@ function del_project() {
fi
}
source $@
echo "[xApp] Generation Script '$1' ended."
cd ..
echo "[xApp] Copying '$1' to '$APP'"
cp $1 $APP
if [ "$1" = "" ]; then
echo "[xApp] Please specify atleast one .xapp definition"
else
for xapp in "$@"; do
SCRIPT="$1"
source $1
done
fi
echo "[xApp] Finished."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment