File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -171,22 +171,23 @@ jobs:
171
171
172
172
- name : 🚧 Generate versions.json
173
173
run : |
174
- echo "[]" > docs/versions.json
175
- for version in docs/*; do
176
- if [ -d "docs/$version" ]; then
174
+ cd docs
175
+ echo "[]" > versions.json
176
+ for version in *; do
177
+ if [ -d "$version" ]; then
177
178
aliases="[]"
178
179
if [ "$version" == "master" ]; then
179
180
aliases="[\"latest\"]"
180
181
fi
181
182
echo "Adding $version at /en/$version..."
182
- jq --arg version ${version} --argjson aliases ${aliases} '. + [{"version": "/en/$version", "title": "$version", "aliases": $aliases}]' docs/ versions.json > docs/ versions.json
183
+ jq --arg version ${version} --argjson aliases ${aliases} '. + [{"version": "/en/$version", "title": "$version", "aliases": $aliases}]' versions.json > versions.json
183
184
else
184
- echo "docs/ $version is not a directory, ignoring"
185
+ echo "$version is not a directory, ignoring"
185
186
fi
186
187
done
187
188
188
189
echo "Versions:"
189
- cat docs/ versions.json
190
+ cat versions.json
190
191
191
192
- name : 🚀 Commit & deploy
192
193
uses : EndBug/add-and-commit@v9
You can’t perform that action at this time.
0 commit comments