From 069e13b863e2a4b003527f1dd8fb8c8a48d101f7 Mon Sep 17 00:00:00 2001 From: Rezart Qelibari Date: Sun, 23 Jan 2022 17:57:14 +0100 Subject: [PATCH] Allow different repo urls in bootstrap.sh for dev Having to clone from github or a remote repository in general during development is a waste of bandwidth, time and does not work during development while a change is being tested and not yet commited or pushed. Now remote urls can be configured through two env variables: MACOS_SYSTEM_REPO_URL and ZSHLIB_REPO_URL. --- bootstrap.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index e397897..c61a922 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,10 +1,23 @@ #!/usr/bin/env zsh +function cloneMacOSSystemRepo() { + local repoUrl="${MACOS_SYSTEM_REPO_URL:-https://github.com/astzweig/macos-system.git}" + git clone -q "${repoUrl}" . +} + +function cloneZSHLibRepo() { + local zshlibRepoUrl="${ZSHLIB_REPO_URL:-https://github.com/astzweig/zshlib.git}" + git config --file=.gitmodules submodule.zshlib.url "${zshlibRepoUrl}" + git submodule -q sync + git submodule -q update --init --recursive --remote +} + function main() { local tmddir="`mktemp -d -t 'macos-system'`" trap 'rm -fr -- "${tmpdir}"' EXIT pushd -q "${tmddir}" - git clone -q --recurse-submodules https://github.com/astzweig/macos-system.git . + cloneMacOSSystemRepo + cloneZSHLibRepo ./install.sh popd -q }