17 lines
639 B
Bash
Executable File
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 |