aerospace fork
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263#!/usr/bin/env bashcd "$(dirname "$0")"source ./script/setup.sh
export XCODEGEN_AEROSPACE_CODE_SIGN_IDENTITY="deewm-codesign-certificate"build_version="0.0.0-SNAPSHOT"generate_xcodeproj=1generate_cmd_help=1generate_git_hash=0while test $# -gt 0; do case $1 in --build-version) build_version="$2"; shift 2 ;; --codesign-identity) XCODEGEN_AEROSPACE_CODE_SIGN_IDENTITY="$2"; shift 2 ;; --generate-git-hash) generate_git_hash=1; shift 1;; --ignore-cmd-help) generate_cmd_help=0; shift 1 ;; --ignore-xcodeproj) generate_xcodeproj=0; shift 1 ;; *) echo "Unknown option $1"; exit 1 ;; esacdone
if test $generate_cmd_help = 1; then # It takes 300ms for the script to complete ./script/generate-cmd-help.shfi
cat > Sources/Common/versionGenerated.swift <<EOF// FILE IS GENERATED BY generate.shpublic let aeroSpaceAppVersion = "$build_version"EOF
entries() { for file in docs/aerospace-*.adoc; do if grep -q 'exec-and-forget' <<< $file; then continue fi subcommand=$(basename $file | sed 's/^aerospace-//' | sed 's/\.adoc$//') desc="$(grep :manpurpose: "$file" | sed -E 's/:manpurpose: //')" echo " [\" $subcommand\", \"$desc\"]," done}
cat <<EOF > ./Sources/Cli/subcommandDescriptionsGenerated.swift// FILE IS GENERATED FROM docs/aerospace-*.adoc files// TO REGENERATE THE FILE RUN generate.sh
let subcommandDescriptions = [$(entries)]EOF
cat <<EOF > ./Sources/Common/gitHashGenerated.swift// FILE IS GENERATED BY generate.shpublic let gitHash = "$(if test $generate_git_hash = 0; then echo "SNAPSHOT"; else git rev-parse HEAD; fi)"public let gitShortHash = "$(if test $generate_git_hash = 0; then echo "SNAPSHOT"; else git rev-parse --short HEAD; fi)"EOF
if test $generate_xcodeproj = 1; then export XCODEGEN_AEROSPACE_VERSION=$build_version ./script/install-dep.sh --xcodegen cd xcode ../.deps/xcodegen/xcodegen # https://github.com/yonaskolb/XcodeGenfi