add arguments to support customized working dir

This commit is contained in:
Casper Chang
2021-01-04 13:12:17 +08:00
parent 68f308d8ce
commit 45a6f05dde
6 changed files with 65 additions and 32 deletions

View File

@@ -1,9 +1,15 @@
#!/bin/bash
SCRIPT_DIR=${HOME}/chrome/daily_routine_repo
WORKING_DIR=${HOME}/chrome/dailyBuildToT
# WORKING_DIR=/home/casperchang/chrome/ToT
#
# enter working directory
#
_working_dir_name=$1
_working_dir_name=${_working_dir_name::-1}
_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