fix repo init for branch

This commit is contained in:
Casper Chang
2021-01-06 14:33:05 +08:00
parent 684f68418f
commit 221d3dfe99
3 changed files with 25 additions and 23 deletions

View File

@@ -9,20 +9,20 @@ if [ ${_working_dir_name: -1} = " " ]; then
_working_dir_name=${_working_dir_name::-1}
fi
_mydir="$(pwd)"
_parentdir="$(dirname "$_mydir")"
_working_full_path="${_parentdir}/${_working_dir_name}"
_working_full_path=${_working_full_path// /}
mkdir -p ${_working_full_path}
cd ${_working_full_path}
echo "INFO: Created new directory: ${_working_full_path}"
if [ -z "$2" ]
then
echo "INFO: copy local manifests, No branch specified"
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git
else
echo "INFO: copy local manifests, branch: $2"
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git -b $2
fi
_mydir="$(pwd)"
_parentdir="$(dirname "$_mydir")"
_working_full_path="${_parentdir}/${_working_dir_name}"
_working_full_path=${_working_full_path// /}
mkdir -p ${_working_full_path}
cd ${_working_full_path}
echo "INFO: Created new directory: ${_working_full_path}"
#
# Do repo init
#
repo init -u https://chromium.googlesource.com/chromiumos/manifest.git --repo-url https://chromium.googlesource.com/external/repo.git