Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Scripts/_setup_script
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@ if ! cd -- "${mas_dir}"; then
printf $'Error: Failed to cd into mas directory: %s\n' "${mas_dir}" >&2
exit 1
fi

print_header() {
if [[ -t 1 ]]; then
printf $'\e[1;34m==>\e[0m'
else
printf $'==>'
fi
printf $' %s' "${@}"
printf $'\n'
}
2 changes: 1 addition & 1 deletion Scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 👢 Bootstrapping mas %s\n' "$(Scripts/version)"
print_header '👢 Bootstrapping mas' "$(Scripts/version)"

if ! whence brew >/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand Down
2 changes: 1 addition & 1 deletion Scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🏗​ Building mas %s\n' "$(Scripts/version)"
print_header '🏗​ Building mas' "$(Scripts/version)"

Scripts/generate_package_swift "${1:-}"

Expand Down
2 changes: 1 addition & 1 deletion Scripts/clean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🗑​ Cleaning mas %s\n' "$(Scripts/version)"
print_header '🗑​ Cleaning mas' "$(Scripts/version)"

swift package clean
swift package reset
Expand Down
2 changes: 1 addition & 1 deletion Scripts/format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🧹 Formatting mas %s\n' "$(Scripts/version)"
print_header '🧹 Formatting mas' "$(Scripts/version)"

for formatter in markdownlint-cli2 swiftformat swiftlint yamllint; do
if ! whence "${formatter}" >/dev/null; then
Expand Down
2 changes: 1 addition & 1 deletion Scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🚨 Linting mas %s\n' "$(Scripts/version)"
print_header '🚨 Linting mas' "$(Scripts/version)"

Scripts/generate_package_swift lint

Expand Down
2 changes: 1 addition & 1 deletion Scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build_dir=.build
destination_root="${build_dir}/destination"
version="$(Scripts/version)"

printf $'==> 📦 Assembling installer package for mas %s\n' "${version}"
print_header '📦 Packaging installer for mas' "${version}"

ditto -v "${build_dir}/apple/Products/Release/mas" "${destination_root}/mas"

Expand Down
3 changes: 2 additions & 1 deletion Scripts/release_cancel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

tag="${1}"

printf $'==> ❌ Canceling release for tag %s\n\n' "${tag}"
print_header '❌ Canceling release for tag' "${tag}"
printf $'\n'

bump_url="$(gh release -R https://github.com/mas-cli/mas download "${tag}" -p bump.url -O - 2>/dev/null || true)"
if [[ -n "${bump_url}" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion Scripts/release_start
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ tag="${1}"
title="${2}"
ref="${3:-HEAD}"

printf $'==> 🚀 Starting release for mas %s\n\n' "${tag#v}"
print_header '🚀 Starting release for mas' "${tag#v}"
printf $'\n'

if [[ ! "${tag}" =~ '^v[[:digit:]]+(\.[[:digit:]]+)*(-(alpha|beta|rc)\.[[:digit:]]+)?$' ]]; then
printf $'\'%s\' is not a valid version tag\n' "${tag}" >&2
Expand Down
2 changes: 1 addition & 1 deletion Scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

. "${0:a:h}/_setup_script"

printf $'==> 🧪 Testing mas %s\n' "$(Scripts/version)"
print_header '🧪 Testing mas' "$(Scripts/version)"

Scripts/generate_package_swift test

Expand Down