Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for applying the offline-mode to the current branch #9951

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading