mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
🔨 Add frozen (-f) option to bootstrap script
GHA jobs use -f so pinned version of tools are installed, if necessary. New bootstrap-update make target upgrades tools
This commit is contained in:
parent
37cf3116b1
commit
1b7d6fd81b
4 changed files with 39 additions and 6 deletions
2
.github/workflows/pr-checks.yml
vendored
2
.github/workflows/pr-checks.yml
vendored
|
@ -28,7 +28,7 @@ jobs:
|
|||
# A fetch-depth of 0 includes all history and tags for script/version
|
||||
fetch-depth: 0
|
||||
- name: Bootstrap
|
||||
run: script/bootstrap
|
||||
run: script/bootstrap -f
|
||||
- name: Build
|
||||
run: script/build
|
||||
- name: Test
|
||||
|
|
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
|
@ -59,7 +59,7 @@ jobs:
|
|||
|
||||
- name: 👢 Bootstrap
|
||||
run: |
|
||||
script/bootstrap
|
||||
script/bootstrap -f
|
||||
|
||||
# Important to trigger a universal build first as package just works with
|
||||
# the `mas` binary in finds in the build dir.
|
||||
|
@ -91,7 +91,7 @@ jobs:
|
|||
|
||||
- name: 👢 Bootstrap
|
||||
run: |
|
||||
script/bootstrap
|
||||
script/bootstrap -f
|
||||
|
||||
- name: 🍺 Update Homebrew mas formula
|
||||
run: |
|
||||
|
@ -110,7 +110,7 @@ jobs:
|
|||
|
||||
- name: 👢 Bootstrap
|
||||
run: |
|
||||
script/bootstrap
|
||||
script/bootstrap -f
|
||||
|
||||
- name: 🚰 Update mas tap formula
|
||||
run: |
|
||||
|
|
4
Makefile
4
Makefile
|
@ -72,6 +72,10 @@ init: ## Installs tools.
|
|||
|
||||
.PHONY: bootstrap
|
||||
bootstrap: ## Installs tools.
|
||||
script/bootstrap -f
|
||||
|
||||
.PHONY: bootstrap-update
|
||||
bootstrap-update: ## Upgrades and installs tools.
|
||||
script/bootstrap
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -6,14 +6,43 @@
|
|||
# Installs development dependencies and builds project dependencies.
|
||||
#
|
||||
|
||||
function usage {
|
||||
echo "Usage: bootstrap [-f]"
|
||||
echo " -f option enables frozen mode"
|
||||
exit 1
|
||||
}
|
||||
|
||||
frozen=''
|
||||
|
||||
# Detect presence of `-f` frozen option
|
||||
while getopts "f" opt; do
|
||||
echo "${opt}"
|
||||
case "${opt}" in
|
||||
f)
|
||||
frozen='-f'
|
||||
;;
|
||||
*)
|
||||
usage 1>&2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
main() {
|
||||
script/clean
|
||||
|
||||
|
||||
echo "==> 👢 Bootstrapping"
|
||||
|
||||
# Install Homebrew tools
|
||||
if [[ "${frozen}" == "-f" ]]; then
|
||||
# --no-lock Don't touch Brewfile.lock.json
|
||||
brew bundle install --no-lock --no-upgrade --verbose
|
||||
else
|
||||
# Allow upgrades
|
||||
rm -f Brewfile.lock.json
|
||||
brew bundle install --no-upgrade --verbose
|
||||
brew bundle install --verbose
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -x "$(command -v mise)" ]]; then
|
||||
brew install mise
|
||||
|
|
Loading…
Reference in a new issue