r3 updates
parent
11a4ecb03a
commit
779069a810
|
@ -21,7 +21,7 @@ r3_completions() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${#COMP_WORDS[@]}" == "4" ]; then
|
if [ "${#COMP_WORDS[@]}" == "4" ]; then
|
||||||
COMPREPLY=($(compgen -W "base extends component_base component_extends entity_base entity_extends r3_base runtime_base runtime_extends system_base system_extends static" "${COMP_WORDS[3]}"))
|
COMPREPLY=($(compgen -W "base extends object_base object_extends component_base component_extends entity_base entity_extends r3_base runtime_base runtime_extends system_base system_extends static" "${COMP_WORDS[3]}"))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${#COMP_WORDS[@]}" == "5" ] && [ "${COMP_WORDS[3]}" == "component_extends" ] ; then
|
if [ "${#COMP_WORDS[@]}" == "5" ] && [ "${COMP_WORDS[3]}" == "component_extends" ] ; then
|
||||||
|
@ -29,6 +29,11 @@ r3_completions() {
|
||||||
COMPREPLY=($(compgen -W "${classes}" "${COMP_WORDS[4]}"))
|
COMPREPLY=($(compgen -W "${classes}" "${COMP_WORDS[4]}"))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${#COMP_WORDS[@]}" == "5" ] && [ "${COMP_WORDS[3]}" == "object_extends" ] ; then
|
||||||
|
local classes=$(grep "^class" "${R3_INSTALL_PATH}"/r3-libs/r3-v2/src/r3/r3-r3-object.js | perl -pe "s/.*class\s*(\w.*?)\s.*/\1/" | perl -pe 's/\n/ /g')
|
||||||
|
COMPREPLY=($(compgen -W "${classes}" "${COMP_WORDS[4]}"))
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${#COMP_WORDS[@]}" == "5" ] && [ "${COMP_WORDS[3]}" == "entity_extends" ] ; then
|
if [ "${#COMP_WORDS[@]}" == "5" ] && [ "${COMP_WORDS[3]}" == "entity_extends" ] ; then
|
||||||
local classes=$(grep "^class" "${R3_INSTALL_PATH}"/r3-libs/r3-v2/src/r3/r3-entity/*.js | perl -pe "s/.*class\s*(\w.*?)\s.*/\1/" | perl -pe 's/\n/ /g')
|
local classes=$(grep "^class" "${R3_INSTALL_PATH}"/r3-libs/r3-v2/src/r3/r3-entity/*.js | perl -pe "s/.*class\s*(\w.*?)\s.*/\1/" | perl -pe 's/\n/ /g')
|
||||||
COMPREPLY=($(compgen -W "${classes}" "${COMP_WORDS[4]}"))
|
COMPREPLY=($(compgen -W "${classes}" "${COMP_WORDS[4]}"))
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1c6f6a3755366afc81687856c41902756847902f
|
Subproject commit 40e85bf6d4c9e8872de9a0445e43d8b0bb646e30
|
24
r3.sh
24
r3.sh
|
@ -58,6 +58,12 @@ cleanup() {
|
||||||
|
|
||||||
cd "${CWD}" 2>&1 || exit
|
cd "${CWD}" 2>&1 || exit
|
||||||
}
|
}
|
||||||
|
echo ' _____ __ ';
|
||||||
|
echo ' _____|__ / _____/ /_ ';
|
||||||
|
echo ' / ___/ /_ < / ___/ __ \';
|
||||||
|
echo ' / / ___/ /_ (__ ) / / /';
|
||||||
|
echo '/_/ /____/(_)____/_/ /_/ ';
|
||||||
|
echo ''
|
||||||
|
|
||||||
R3_INSTALL_PATH=/usr/share/cybafelo/r3/r3-cloud
|
R3_INSTALL_PATH=/usr/share/cybafelo/r3/r3-cloud
|
||||||
R3_V2_LIB_PATH=${R3_INSTALL_PATH}/r3-libs/r3-v2
|
R3_V2_LIB_PATH=${R3_INSTALL_PATH}/r3-libs/r3-v2
|
||||||
|
@ -66,6 +72,7 @@ R3_FOLDER="${R3_V2_SRC_PATH}/r3/"
|
||||||
R3_SYSTEM_FOLDER="${R3_V2_SRC_PATH}/r3/r3-system/"
|
R3_SYSTEM_FOLDER="${R3_V2_SRC_PATH}/r3/r3-system/"
|
||||||
R3_COMPONENT_FOLDER="${R3_V2_SRC_PATH}/r3/r3-component/"
|
R3_COMPONENT_FOLDER="${R3_V2_SRC_PATH}/r3/r3-component/"
|
||||||
R3_RUNTIME_FOLDER="${R3_V2_SRC_PATH}/r3/r3-runtime/"
|
R3_RUNTIME_FOLDER="${R3_V2_SRC_PATH}/r3/r3-runtime/"
|
||||||
|
R3_OBJECT_FOLDER="${R3_V2_SRC_PATH}/r3/r3-object/"
|
||||||
R3_ENTITY_FOLDER="${R3_V2_SRC_PATH}/r3/r3-entity/"
|
R3_ENTITY_FOLDER="${R3_V2_SRC_PATH}/r3/r3-entity/"
|
||||||
TEMPLATE_FOLDER="${R3_V2_SRC_PATH}/templates/"
|
TEMPLATE_FOLDER="${R3_V2_SRC_PATH}/templates/"
|
||||||
|
|
||||||
|
@ -82,6 +89,12 @@ trap cleanup EXIT
|
||||||
|
|
||||||
cd "${R3_INSTALL_PATH}" 2>&1 || exit 2
|
cd "${R3_INSTALL_PATH}" 2>&1 || exit 2
|
||||||
|
|
||||||
|
#ENV_FILE='.env'
|
||||||
|
#
|
||||||
|
#export $(egrep -v '^#' "${ENV_FILE}" | xargs)
|
||||||
|
#
|
||||||
|
#echo "${API_URL}";
|
||||||
|
|
||||||
if [ "${TASK}" = 'update-token-db' ];
|
if [ "${TASK}" = 'update-token-db' ];
|
||||||
then
|
then
|
||||||
echo "updating token.db"
|
echo "updating token.db"
|
||||||
|
@ -96,7 +109,8 @@ then
|
||||||
|
|
||||||
CLASS_NAME=$ARG1
|
CLASS_NAME=$ARG1
|
||||||
TEMPLATE="${ARG2}.template"
|
TEMPLATE="${ARG2}.template"
|
||||||
FILE_NAME="r3$(echo "${CLASS_NAME}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}').js"
|
|
||||||
|
FILE_NAME="$(echo "r3${CLASS_NAME}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed 's/r3\-r3\-/r3-/' | sed 's/r3\-r3/r3/').js"
|
||||||
|
|
||||||
SUBFOLDER='./'
|
SUBFOLDER='./'
|
||||||
if [ -n "${ARG4}" ];
|
if [ -n "${ARG4}" ];
|
||||||
|
@ -117,7 +131,7 @@ then
|
||||||
if [[ "${ARG2}" =~ ^.*extends$ ]];
|
if [[ "${ARG2}" =~ ^.*extends$ ]];
|
||||||
then
|
then
|
||||||
EXTEND_CLASS="${ARG3}"
|
EXTEND_CLASS="${ARG3}"
|
||||||
EXTEND_CLASS_FILE_NAME="r3$(echo "${EXTEND_CLASS}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}').js"
|
EXTEND_CLASS_FILE_NAME="$(echo "r3${EXTEND_CLASS}" | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed 's/r3\-r3\-/r3-/' | sed 's/r3\-r3/r3/').js"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ARG2}" =~ ^.*base$ ]] ||
|
if [[ "${ARG2}" =~ ^.*base$ ]] ||
|
||||||
|
@ -222,6 +236,10 @@ check_file_found() {
|
||||||
FILE="${R3_ENTITY_FOLDER}${ORIG_FILE}"
|
FILE="${R3_ENTITY_FOLDER}${ORIG_FILE}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f "${FILE}" ]; then
|
||||||
|
FILE="${R3_OBJECT_FOLDER}${ORIG_FILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f "${FILE}" ]; then
|
if [ ! -f "${FILE}" ]; then
|
||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
|
@ -260,7 +278,7 @@ then
|
||||||
sed -i -E 's/([0-9]+\.[0-9]+\.)([0-9]+)/echo "\1$((\2+1))"/e' version
|
sed -i -E 's/([0-9]+\.[0-9]+\.)([0-9]+)/echo "\1$((\2+1))"/e' version
|
||||||
|
|
||||||
COMMANDS=$(grep "r3 create" .r3_history | sed "s/^.*r3 /r3 /" | sed "s/\s+/ /g" | sort --unique | perl -pe "s/\n/,/" | perl -pe "s/\s+,/,/g" | perl -pe "s/,$//")
|
COMMANDS=$(grep "r3 create" .r3_history | sed "s/^.*r3 /r3 /" | sed "s/\s+/ /g" | sort --unique | perl -pe "s/\n/,/" | perl -pe "s/\s+,/,/g" | perl -pe "s/,$//")
|
||||||
FILES=$(grep "r3 create" .r3_history | sed "s/^.*r3 /r3 /" | sed "s/\s+/ /g" | sort --unique | cut -d' ' -f3 | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed "s/^/r3/" | sed "s/$/.js/")
|
FILES=$(grep "r3 create" .r3_history | sed "s/^.*r3 /r3 /" | sed "s/\s+/ /g" | sort --unique | cut -d' ' -f3 | sed 's/\([A-Z]\)/-\1/g' | awk '{print tolower($0)}' | sed "s/^/r3/" | sed 's/r3\-r3\-/r3-/' | sed "s/$/.js/" | sed 's/r3\-r3\.js/r3.js/')
|
||||||
|
|
||||||
IFS=',' read -a commands <<< $COMMANDS
|
IFS=',' read -a commands <<< $COMMANDS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue