Skip to content

Commit c99feea

Browse files
committed
Update REPL docs on npm publish
1 parent bcd8236 commit c99feea

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

tools/scripts/npm_publish

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ update_package_meta_data() {
212212
if [[ -n "$(git status --porcelain)" ]]; then
213213
echo '' >&2
214214
echo 'Committing changes...' >&2
215-
git add . && git commit -m 'Update directories meta data'
215+
git add -A && git commit -m 'Update directories meta data'
216216
if [[ "$?" -ne 0 ]]; then
217217
echo '' >&2
218218
echo 'Error: unexpected error. Unable to commit changes.' >&2
@@ -241,7 +241,36 @@ update_markdown_package_urls() {
241241
if [[ -n "$(git status --porcelain)" ]]; then
242242
echo '' >&2
243243
echo 'Committing changes...' >&2
244-
git add . && git commit -m 'Update package URLs'
244+
git add -A && git commit -m 'Update package URLs'
245+
if [[ "$?" -ne 0 ]]; then
246+
echo '' >&2
247+
echo 'Error: unexpected error. Unable to commit changes.' >&2
248+
echo '' >&2
249+
return 1
250+
fi
251+
echo 'Successfully committed changes.' >&2
252+
fi
253+
echo '' >&2
254+
255+
return 0
256+
}
257+
258+
# Updates REPL documentation.
259+
update_repl_docs() {
260+
echo 'Updating REPL documentation...' >&2
261+
make repl-docs
262+
if [[ "$?" -ne 0 ]]; then
263+
echo '' >&2
264+
echo 'Error: unexpected error. Encountered an error when updating REPL documentation.' >&2
265+
echo '' >&2
266+
return 1
267+
fi
268+
echo 'Successfully updated REPL documentation.' >&2
269+
270+
if [[ -n "$(git status --porcelain)" ]]; then
271+
echo '' >&2
272+
echo 'Committing changes...' >&2
273+
git add -A && git commit -m 'Update REPL docs'
245274
if [[ "$?" -ne 0 ]]; then
246275
echo '' >&2
247276
echo 'Error: unexpected error. Unable to commit changes.' >&2
@@ -272,7 +301,7 @@ update_version() {
272301
if [[ -n "$(git status --porcelain)" ]]; then
273302
echo '' >&2
274303
echo 'Committing changes...' >&2
275-
git add . && git commit -m "${message}"
304+
git add -A && git commit -m "${message}"
276305
if [[ "$?" -ne 0 ]]; then
277306
echo '' >&2
278307
echo 'Error: unexpected error. Unable to commit changes.' >&2
@@ -311,7 +340,7 @@ publish_bundles() {
311340
if [[ -n "$(git status --porcelain)" ]]; then
312341
echo '' >&2
313342
echo 'Committing changes...' >&2
314-
git add . && git commit -m 'Update dist versions'
343+
git add -A && git commit -m 'Update dist versions'
315344
if [[ "$?" -ne 0 ]]; then
316345
echo '' >&2
317346
echo 'Error: unexpected error. Unable to commit changes.' >&2
@@ -458,6 +487,11 @@ main() {
458487
revert_changes
459488
on_error 1
460489
fi
490+
update_repl_docs
491+
if [[ "$?" -ne 0 ]]; then
492+
revert_changes
493+
on_error 1
494+
fi
461495
update_version
462496
if [[ "$?" -ne 0 ]]; then
463497
revert_changes

0 commit comments

Comments
 (0)