Created
July 22, 2022 18:00
-
-
Save adamblvck/4a06ee4bd04d9c00c53ab17bc500d088 to your computer and use it in GitHub Desktop.
Bash script, allowing one to quickly fix key import lines, allowing Expo-based developers to make WebView Crypto work in their projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this file in root of your expo project. Don't forget to execute `chmod +x ./gundb_expo_fix.sh` | |
# Run the file after every `npm install` or `expo install` as those commands revert changes done by this script | |
##### Fix first file | |
# replace first line of code with working import | |
sed '1 c\ | |
import serializeError from "serialize-error";' node_modules/webview-crypto/src/MainWorker.ts > tmp_file.ts | |
# overwrite file to fix, and remove tmp-file | |
cat tmp_file.ts > node_modules/webview-crypto/src/MainWorker.ts | |
rm -rf tmp_file.ts | |
###### Fix second file | |
# replace first line of code with working import | |
sed '1 c\ | |
import find from "lodash/find";' node_modules/webview-crypto/src/asyncSerialize.ts > tmp_file.ts | |
# overwrite file to fix, and remove tmp-file | |
cat tmp_file.ts > node_modules/webview-crypto/src/asyncSerialize.ts | |
rm -rf tmp_file.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment