diff --git a/Installer/env/env.bash b/Installer/env/env.bash index 24b73d1..7563b5a 100644 --- a/Installer/env/env.bash +++ b/Installer/env/env.bash @@ -1,7 +1,8 @@ #!/bin/bash export OS_TYPE=`uname` export SIM_DIR=`pwd`/simulator -export INS_DIR=`pwd`/installer +export WORK_DIR=`pwd` +export INS_DIR=${WORK_DIR}/../Installer/installer export CFG_DIR=`pwd`/config export ROOT_DIR=`pwd` export EV3RT_DIR=${SIM_DIR}/ev3rt-athrill-v850e2m diff --git a/Installer/installer/create-project.bash b/Installer/installer/create-project.bash index a621780..7106469 100644 --- a/Installer/installer/create-project.bash +++ b/Installer/installer/create-project.bash @@ -6,7 +6,9 @@ then exit 1 fi -bash installer/utils/create_empty.bash ${1} +source config/config.bash + +bash ${INS_DIR}/utils/create_empty.bash ${1} echo "### create config.json for unity" bash config/scripts/create_config.bash ${1} unity diff --git a/Installer/installer/import-project.bash b/Installer/installer/import-project.bash index 5f989f5..9fa37eb 100644 --- a/Installer/installer/import-project.bash +++ b/Installer/installer/import-project.bash @@ -8,7 +8,7 @@ then fi echo "### Importing sample" -bash installer/utils/sample_import.bash ${1} +bash ${INS_DIR}/utils/sample_import.bash ${1} echo "### create config.json for unity" bash config/scripts/create_config.bash ${1} unity diff --git a/Installer/installer/install-single-robot.bash b/Installer/installer/install-single-robot.bash index 80535ce..f9b4bdf 100644 --- a/Installer/installer/install-single-robot.bash +++ b/Installer/installer/install-single-robot.bash @@ -4,7 +4,7 @@ source env/env.bash cd simulator -TOOL_DIR=../installer/utils +TOOL_DIR=${INS_DIR}/utils which athrill2 > /dev/null if [ $? -ne 0 ] diff --git a/ProjectManager/create_workspace.bash b/ProjectManager/create_workspace.bash new file mode 100644 index 0000000..c0c7966 --- /dev/null +++ b/ProjectManager/create_workspace.bash @@ -0,0 +1,41 @@ +#!/bin/bash + +if [ $# -ne 1 ] +then + echo "Usage: $0 " + exit 1 +fi + +if [ -d Installer ] +then + : +else + echo "ERROR: can not found Installer" + exit 1 +fi + +WORKSPACE_NAME=${1} + +function create_workspace_template() +{ + if [ -d ${WORKSPACE_NAME} ] + then + echo "ERROR: ${WORKSPACE_NAME} already exists." + exit 1 + fi + mkdir ${WORKSPACE_NAME} + mkdir ${WORKSPACE_NAME}/config + cp -rp Installer/config/* ${WORKSPACE_NAME}/config/ + mkdir ${WORKSPACE_NAME}/env + cp -rp Installer/env/* ${WORKSPACE_NAME}/env/ + mkdir ${WORKSPACE_NAME}/build + cp -rp Installer/build/* ${WORKSPACE_NAME}/build/ + mkdir ${WORKSPACE_NAME}/simulator + mkdir ${WORKSPACE_NAME}/simulator/unity + mkdir ${WORKSPACE_NAME}/simulator/unity/project + mkdir ${WORKSPACE_NAME}/downloads + mkdir ${WORKSPACE_NAME}/tools +} + +create_workspace_template +