mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
💡 Add file header doc comments to scripts
This commit is contained in:
parent
fe03ab7727
commit
e4123a5653
18 changed files with 120 additions and 32 deletions
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/archive
|
||||
# mas
|
||||
#
|
||||
# Compresses artifacts so the can be archived more easily.
|
||||
#
|
||||
|
||||
pushd build
|
||||
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/bootstrap
|
||||
# mas
|
||||
#
|
||||
# Installs gem tools, installs Swift dependencies via CocoaPods and sorts
|
||||
# the Xcode project file references.
|
||||
#
|
||||
|
||||
main() {
|
||||
echo "==> 👢 Bootstrapping"
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# script/bottle
|
||||
# mas
|
||||
#
|
||||
# Builds bottles of mas Homebrew formula.
|
||||
# Builds bottles of mas Homebrew formula for custom tap:
|
||||
# https://github.com/mas-cli/homebrew-tap
|
||||
#
|
||||
|
||||
BUILD_DIR="$PWD/build"
|
||||
|
|
|
@ -1,4 +1,13 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/build
|
||||
# mas
|
||||
#
|
||||
# Builds the Xcode project. Uses xcpretty gem to format output.
|
||||
#
|
||||
# If the TRAVIS_TAG env variable is present, it generates an archive.
|
||||
# https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
|
||||
#
|
||||
|
||||
BUILD_DIR="$PWD/build"
|
||||
PROJECT="mas-cli.xcodeproj"
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/clean
|
||||
# mas
|
||||
#
|
||||
# Deletes the build and temp install directories.
|
||||
#
|
||||
|
||||
BUILD_DIR=build
|
||||
INSTALL_DIR=/tmp/mas-cli.dst
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/danger
|
||||
# mas-cli
|
||||
# mas
|
||||
#
|
||||
# Invokes the danger gem through bundler for automated PR review.
|
||||
# https://danger.systems/
|
||||
#
|
||||
|
||||
echo "==> ⚠️ Running danger"
|
||||
|
|
|
@ -1,8 +1,18 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/install
|
||||
# This script is called by the Homebrew formula, so should not
|
||||
# rely on any dependencies.
|
||||
# mas
|
||||
#
|
||||
# Installs mas into PREFIX using the following steps:
|
||||
#
|
||||
# 1. Invokes the xcodebuild install action.
|
||||
# 2. Copies the mas binary and MasKit.framework bundle into their correct
|
||||
# relative positions under PREFIX.
|
||||
# 3. Linker paths are updated on the mas binary so it can find MasKit under PREFIX.
|
||||
#
|
||||
# NOTE: This script is called by the mas Homebrew formula so it has only system
|
||||
# dependencies aside from xcodebuild.
|
||||
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/mas.rb
|
||||
#
|
||||
|
||||
BUILD_DIR="$PWD/build"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/lint
|
||||
# mas-cli
|
||||
# mas
|
||||
#
|
||||
# Linting checks for CI "Lint" stage.
|
||||
#
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/package
|
||||
# mas
|
||||
#
|
||||
# Builds macOS installer component and distribution packages.
|
||||
#
|
||||
|
||||
BUILD_DIR="$PWD/build"
|
||||
COMPONENT_PACKAGE="$BUILD_DIR/mas_components.pkg"
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/package_install
|
||||
# mas
|
||||
#
|
||||
# Installs the mas distribution package. Requires sudo access.
|
||||
#
|
||||
|
||||
IDENTIFIER=com.mphys.mas-cli
|
||||
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/release
|
||||
# mas
|
||||
#
|
||||
# Updates app version in Info.plist file and tags release commit.
|
||||
# Not currently in use.
|
||||
#
|
||||
|
||||
PLIST_FILE="$PWD/App/mas-cli-Info.plist"
|
||||
|
||||
|
@ -29,7 +36,7 @@ update_version_number() {
|
|||
|
||||
# Ask for the new one
|
||||
new_version_number=$(prompt "Enter version number [${version_number}]: ")
|
||||
|
||||
|
||||
if [[ -z $new_version_number ]]; then
|
||||
echo "No version number specified"
|
||||
return 1
|
||||
|
@ -54,7 +61,7 @@ write_version_number() {
|
|||
}
|
||||
|
||||
read_version_number() {
|
||||
read_plist "CFBundleShortVersionString"
|
||||
read_plist "CFBundleShortVersionString"
|
||||
}
|
||||
|
||||
read_plist() {
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# script/sort
|
||||
# mas
|
||||
#
|
||||
# Invokes the sort.pl script on the Xcode project to organize project references.
|
||||
#
|
||||
|
||||
main() {
|
||||
echo "==> 📶 Sorting project files"
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/usr/bin/perl -w
|
||||
#
|
||||
# script/sort.pl
|
||||
# mas
|
||||
#
|
||||
# Sorts "children" and "files" sections in Xcode project.pbxproj files.
|
||||
#
|
||||
|
||||
# Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
|
||||
#
|
||||
|
@ -169,4 +175,4 @@ sub sortFilesByFileName($$)
|
|||
my $aFileName = $1 if $a =~ /^\s*[A-Z0-9]{24} \/\* (.+) in /;
|
||||
my $bFileName = $1 if $b =~ /^\s*[A-Z0-9]{24} \/\* (.+) in /;
|
||||
return lc($aFileName) cmp lc($bFileName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
# script/swiftlint_runscript
|
||||
# mas-cli
|
||||
#
|
||||
# SwiftLint invocation from inside Xcode. Minimal output.
|
||||
# Invokes SwiftLint from inside an Xcode run script build phase. Minimal output.
|
||||
# https://github.com/realm/SwiftLint
|
||||
#
|
||||
|
||||
if test -n "$JENKINS_URL"
|
||||
|
@ -17,7 +18,6 @@ fi
|
|||
# : command: --: invalid option
|
||||
# : command: usage: command [-pVv] command [arg ...]
|
||||
|
||||
|
||||
if command -v swiftlint > /dev/null; then
|
||||
swiftlint lint --quiet
|
||||
else
|
||||
|
|
31
script/test
31
script/test
|
@ -1,14 +1,16 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/test
|
||||
# mas
|
||||
#
|
||||
# Runs mas tests. Uses xcpretty gem to format output.
|
||||
#
|
||||
|
||||
BUILD_DIR="$PWD/build"
|
||||
PROJECT="mas-cli.xcodeproj"
|
||||
SCHEME="mas-cli Debug"
|
||||
CONFIG="Debug"
|
||||
|
||||
main() {
|
||||
test
|
||||
}
|
||||
|
||||
# OBJROOT - Intermediate Build Files Path
|
||||
# The path where intermediate files will be placed during a build. Intermediate files include generated sources, object
|
||||
# files, etc. Shell script build phases can place and access files here, as well. Typically this path is not set per
|
||||
|
@ -22,16 +24,13 @@ main() {
|
|||
# The path at which all products will be placed when performing a build. Typically this path is not set per target,
|
||||
# but is set per-project or per-user. By default, this is set to `$(PROJECT_DIR)/build`.
|
||||
|
||||
test() {
|
||||
echo "==> ✅ Testing"
|
||||
set -o pipefail && \
|
||||
xcodebuild -project "$PROJECT" \
|
||||
-scheme "$SCHEME" \
|
||||
-configuration "$CONFIG" \
|
||||
OBJROOT="$BUILD_DIR" \
|
||||
SYMROOT="$BUILD_DIR" \
|
||||
test \
|
||||
| bundle exec xcpretty --color
|
||||
}
|
||||
echo "==> ✅ Testing"
|
||||
|
||||
main
|
||||
set -o pipefail && \
|
||||
xcodebuild -project "$PROJECT" \
|
||||
-scheme "$SCHEME" \
|
||||
-configuration "$CONFIG" \
|
||||
OBJROOT="$BUILD_DIR" \
|
||||
SYMROOT="$BUILD_DIR" \
|
||||
test \
|
||||
| bundle exec xcpretty --color
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
#!/bin/bash -e
|
||||
#
|
||||
# script/uninstall
|
||||
# mas
|
||||
#
|
||||
# Removes mas and MasKit from PREFIX.
|
||||
#
|
||||
|
||||
PREFIX=/usr/local
|
||||
|
||||
echo "==> 🔥 Uninstalling mas"
|
||||
# Override default prefix path with optional 1st arg
|
||||
if test -n "$1"; then
|
||||
PREFIX="$1"
|
||||
fi
|
||||
|
||||
trash $PREFIX/Frameworks/MasKit.framework
|
||||
trash $PREFIX/bin/mas
|
||||
echo "==> 🔥 Uninstalling mas from $PREFIX"
|
||||
|
||||
trash "$PREFIX/Frameworks/MasKit.framework"
|
||||
trash "$PREFIX/bin/mas"
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
#
|
||||
# script/update_headers
|
||||
# mas
|
||||
#
|
||||
# Runs class-dump to generate headers for Apple private frameworks.
|
||||
#
|
||||
|
||||
main() {
|
||||
check_class_dump
|
||||
|
@ -7,7 +13,6 @@ main() {
|
|||
}
|
||||
|
||||
check_class_dump() {
|
||||
|
||||
if command --quiet --search class-dump; then
|
||||
echo "'class-dump' is not installed" >&2
|
||||
exit 1
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# script/version
|
||||
# mas
|
||||
#
|
||||
# Displays the current marketing version of mas
|
||||
# Displays the current marketing version of mas.
|
||||
#
|
||||
|
||||
agvtool what-marketing-version -terse1
|
||||
|
|
Loading…
Reference in a new issue