fix working dir location

This commit is contained in:
Casper Chang
2021-01-04 16:38:27 +08:00
parent d7d973c280
commit 1f169db2e4
6 changed files with 46 additions and 9 deletions

View File

@@ -2,14 +2,22 @@
#
# enter working directory
#
_mydir="$(pwd)"
SCRIPT_DIR=$_mydir
_working_dir_name=$1
_working_dir_name=${_working_dir_name::-1}
if [ ${_working_dir_name: -1} = " " ]; then
#somehow there's a space char when expect argument
_working_dir_name=${_working_dir_name::-1}
fi
_mydir="$(pwd)"
_parentdir="$(dirname "$_mydir")"
_working_full_path="${_parentdir}/${_working_dir_name}"
cd ${_working_full_path}
echo "working path ${_working_full_path}"
cp -R ${SCRIPT_DIR}/local_manifests ${WORKING_DIR}/.repo
ls ${WORKING_DIR}/.repo
ls ${WORKING_DIR}/.repo/local_manifests
cp -R ${SCRIPT_DIR}/local_manifests ${_working_full_path}/.repo
ls ${_working_full_path}/.repo
ls ${_working_full_path}/.repo/local_manifests