zsh-shell-init/alias.d/opt/notion_update.sh
2023-09-13 17:10:07 +08:00

17 lines
639 B
Bash
Executable File

#!/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