Skip to content

Instantly share code, notes, and snippets.

@evlic
Last active February 9, 2023 05:30
Show Gist options
  • Save evlic/aa6443dc2b4e04a3df6f7197d94e71f0 to your computer and use it in GitHub Desktop.
Save evlic/aa6443dc2b4e04a3df6f7197d94e71f0 to your computer and use it in GitHub Desktop.
#!/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