add branch config support

This commit is contained in:
Casper Chang
2021-01-05 18:11:23 +08:00
parent 1dc0cc6d84
commit a3fed5c785
6 changed files with 45 additions and 12 deletions

View File

@@ -13,11 +13,21 @@ if [ ${_working_dir_name: -1} = " " ]; then
fi
_mydir="$(pwd)"
_parentdir="$(dirname "$_mydir")"
_working_full_path="${_parentdir}/${_working_dir_name}"
cd ${_working_full_path}
echo "working path ${_working_full_path}"
_parentdir="$(dirname "$_mydir")"
_working_full_path="${_parentdir}/${_working_dir_name}"
cd ${_working_full_path}
echo "working path ${_working_full_path}"
if [ -z "$2" ]
then
echo "INFO: copy local manifests, No branch specified"
cp -R ${SCRIPT_DIR}/local_manifests ${_working_full_path}/.repo
else
echo "INFO: copy $2 local manifests"
local_manifest_dir="$2_local_manifests"
cp -R ${SCRIPT_DIR}/${local_manifest_dir} ${_working_full_path}/.repo
mv ${_working_full_path}/.repo/${local_manifest_dir} ${_working_full_path}/.repo/local_manifests
fi
cp -R ${SCRIPT_DIR}/local_manifests ${_working_full_path}/.repo
ls ${_working_full_path}/.repo
ls ${_working_full_path}/.repo/local_manifests