forked from nikitabobko/AeroSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.sh
executable file
·34 lines (28 loc) · 1.08 KB
/
generate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
cd "$(dirname "$0")"
source ./script/setup.sh
version=$(head -1 ./version.txt | awk '{print $1}')
build_number=$(tail -1 ./version.txt | awk '{print $1}')
cat > LocalPackage/Sources/Common/versionGenerated.swift <<EOF
// FILE IS GENERATED BY generate.sh
public let aeroSpaceAppVersion = "$version"
EOF
sed -i "s/CURRENT_PROJECT_VERSION.*/CURRENT_PROJECT_VERSION: $build_number # GENERATED BY generate.sh/" ./project.yml
sed -i "s/MARKETING_VERSION.*/MARKETING_VERSION: $version # GENERATED BY generate.sh/" ./project.yml
entries() {
for file in $(ls docs/aerospace-*.adoc); do
if grep -q 'exec' <<< $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 > ./LocalPackage/Sources/Cli/subcommandDescriptionsGenerated.swift
// FILE IS GENERATED BY generate.sh
let subcommandDescriptions = [
$(entries)
]
EOF
xcodegen # https://github.com/yonaskolb/XcodeGen