From 7e8720f5426ea3a900fbb1a6a34a8d3756bf087a Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Sun, 8 Sep 2024 04:29:12 +0200 Subject: [PATCH] Rename: script/install-deps.sh -> script/install-dep.sh --- .github/workflows/build.yml | 4 ++-- build-shell-completion.sh | 2 +- generate-shell-parser.sh | 2 +- generate.sh | 2 +- run-tests.sh | 4 ++-- script/{install-deps.sh => install-dep.sh} | 28 ++++++---------------- script/setup.sh | 2 +- 7 files changed, 15 insertions(+), 29 deletions(-) rename script/{install-deps.sh => install-dep.sh} (78%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c83e6ab..c59ae2ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,9 @@ jobs: path: | swift-exec-deps/.build .deps - key: ${{ matrix.os }}-${{ runner.arch }}-${{ hashFiles('script/install-deps.sh', 'swift-exec-deps/Package.swift', 'swift-exec-deps/Package.resolved', 'Gemfile', '.bundle/config') }} + key: ${{ matrix.os }}-${{ runner.arch }}-${{ hashFiles('script/install-dep.sh', 'swift-exec-deps/Package.swift', 'swift-exec-deps/Package.resolved', 'Gemfile', '.bundle/config') }} - run: brew install bash fish xcbeautify - - run: ./script/install-deps.sh + - run: ./script/install-dep.sh --all - run: ./build-debug.sh - run: ./run-tests.sh # "-" means "Sign to run locally". There is no aerospace-codesign-certificate in GH Actions diff --git a/build-shell-completion.sh b/build-shell-completion.sh index 46e921a9..c34a4cb3 100755 --- a/build-shell-completion.sh +++ b/build-shell-completion.sh @@ -2,7 +2,7 @@ cd "$(dirname "$0")" source ./script/setup.sh -./script/install-deps.sh --complgen +./script/install-dep.sh --complgen rm -rf .shell-completion && mkdir -p \ .shell-completion/zsh \ diff --git a/generate-shell-parser.sh b/generate-shell-parser.sh index 60d6e9fe..3e458fcf 100755 --- a/generate-shell-parser.sh +++ b/generate-shell-parser.sh @@ -2,7 +2,7 @@ cd "$(dirname "$0")" source ./script/setup.sh -./script/install-deps.sh --antlr +./script/install-dep.sh --antlr ./.deps/python-venv/bin/antlr4 -v 4.13.1 -no-listener -Dlanguage=Swift \ -o ./Sources/ShellParserGenerated \ ./grammar/ShellLexer.g4 \ diff --git a/generate.sh b/generate.sh index 9ec13bb2..8e2479bc 100755 --- a/generate.sh +++ b/generate.sh @@ -57,6 +57,6 @@ EOF if test $generate_xcodeproj = 1; then export XCODEGEN_AEROSPACE_VERSION=$build_version - ./script/install-deps.sh --xcodegen + ./script/install-dep.sh --xcodegen ./swift-exec-deps/.build/debug/xcodegen # https://github.com/yonaskolb/XcodeGen fi diff --git a/run-tests.sh b/run-tests.sh index 7b5752b7..c59bc733 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -8,10 +8,10 @@ swift test ./run-cli.sh -h ./run-cli.sh -v -./script/install-deps.sh --swiftlint +./script/install-dep.sh --swiftlint ./swift-exec-deps/.build/debug/swiftlint lint --quiet -./script/install-deps.sh --swiftformat +./script/install-dep.sh --swiftformat ./swift-exec-deps/.build/debug/swiftformat . ./generate.sh --all diff --git a/script/install-deps.sh b/script/install-dep.sh similarity index 78% rename from script/install-deps.sh rename to script/install-dep.sh index b7f8280f..fc1d727c 100755 --- a/script/install-deps.sh +++ b/script/install-dep.sh @@ -2,7 +2,7 @@ cd "$(dirname "$0")/.." source ./script/setup.sh -all=1 +all=0 antlr=0 complgen=0 swiftlint=0 @@ -10,26 +10,12 @@ swiftformat=0 xcodegen=0 while [[ $# -gt 0 ]]; do case $1 in - --antlr) - antlr=1 - all=0 - shift ;; - --complgen) - all=0 - complgen=1 - shift ;; - --swiftlint) - all=0 - swiftlint=1 - shift ;; - --xcodegen) - all=0 - xcodegen=1 - shift ;; - --swiftformat) - all=0 - swiftformat=1 - shift ;; + --antlr) antlr=1; shift ;; + --complgen) complgen=1; shift ;; + --swiftlint) swiftlint=1; shift ;; + --xcodegen) xcodegen=1; shift ;; + --swiftformat) swiftformat=1; shift ;; + --all) all=1; shift ;; *) echo "Unknown option $1"; exit 1 ;; esac done diff --git a/script/setup.sh b/script/setup.sh index b7e4df61..f233227f 100644 --- a/script/setup.sh +++ b/script/setup.sh @@ -42,7 +42,7 @@ xcodebuild() { # Function: createItemModels(for:itemModelSource:) # Thread: <_NSMainThread: 0x6000037202c0>{number = 1, name = main} # Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. - if cmd-exist xcbeautify; then + if /usr/bin/which xcbeautify &> /dev/null; then /usr/bin/xcodebuild "$@" 2>&1 | xcbeautify --quiet # Only print tasks that have warnings or errors else /usr/bin/xcodebuild "$@" 2>&1