Skip to content

Commit

Permalink
Add script for applying the offline-mode to the current branch (#9951)
Browse files Browse the repository at this point in the history
* Add script for applying the `offline-mode` branch to the current branch
* Add `--reverse` flag
  • Loading branch information
jimchamp authored Oct 11, 2024
1 parent b0af098 commit bd2f887
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/apply_offline_mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#####
# This script applies the changes from the `offline-mode` branch in the `internetarchive/openlibrary` repo.
# These changes will mock or otherwise prevent API calls to Internet Archive, resulting in a better
# developer experience when IA is down.
#####

reverse=''

# Parse command-line arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--reverse)
reverse='--reverse'
shift
;;
*)
# Handle other arguments or show usage
echo "Unknown option: $1"
exit 1
;;
esac
done

curl "https://github.com/internetarchive/openlibrary/compare/master...offline-mode.patch" | git apply $reverse

0 comments on commit bd2f887

Please sign in to comment.