Last active
February 9, 2023 05:30
-
-
Save evlic/aa6443dc2b4e04a3df6f7197d94e71f0 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
folder="/Applications/Notion.app/Contents/Resources/app/renderer" | |
preloadJs="/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" | |
remoteUrl="https://github.com/Reamd7/notion-zh_CN/raw/main/notion-zh_CN.js" | |
name="notion-zh_CN" | |
dst="$name.js" | |
if [ -w "$preloadJs" ]; then | |
# curl -L -o "/Applications/Notion.app/Contents/Resources/app/renderer/notion-zh_CN.js" https://github.com/Reamd7/notion-zh_CN/raw/main/notion-zh_CN.js | |
curl -L -o "$folder/$dst" "$remoteUrl" | |
listLine=$(tail -n 1 $preloadJs) | |
if [ "$listLine" != "require('./$name')" ]; then | |
echo "require('./$name')" >> $preloadJs | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment