Skip to content

Commit f18e57d

Browse files
authored
Merge pull request #96 from rauhul/fix-93
Update check-docs add plugin to all Package files
2 parents b123bda + 23b322b commit f18e57d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/scripts/check-docs.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,20 @@ if ! command -v yq &> /dev/null; then
2626
fatal "yq could not be found. Please install yq to proceed."
2727
fi
2828

29-
if [ ! -f Package.swift ]; then
29+
package_files=$(find . -maxdepth 1 -name 'Package*.swift')
30+
if [ -z "$package_files" ]; then
3031
fatal "Package.swift not found. Please ensure you are running this script from the root of a Swift package."
3132
fi
3233

33-
log "Editing Package.swift..."
34-
cat <<EOF >> "Package.swift"
34+
for package_file in $package_files; do
35+
log "Editing $package_file..."
36+
cat <<EOF >> "$package_file"
3537
3638
package.dependencies.append(
3739
.package(url: "https://github.com/swiftlang/swift-docc-plugin", "1.0.0"..<"1.4.0")
3840
)
3941
EOF
42+
done
4043

4144
log "Checking documentation targets..."
4245
for target in $(yq -r '.builder.configs[].documentation_targets[]' .spi.yml); do

0 commit comments

Comments
 (0)