From 44b1862087b602b7af744a86973552d0cde57471 Mon Sep 17 00:00:00 2001 From: hehaoxiang Date: Sat, 13 Aug 2022 17:35:10 +0800 Subject: [PATCH] feat: update shell sh --- update.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 update.sh diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..dd18e29 --- /dev/null +++ b/update.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +folder="/Applications/Notion.app/Contents/Resources/app/renderer" +preloadJs="/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" +remoteUrl="https://greasyfork.org/scripts/430116-notion-zh-cn-notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC/code/Notion-zh_CN%20notion%E7%9A%84%E6%B1%89%E5%8C%96%E8%84%9A%E6%9C%AC.user.js" + +if [ -w "/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" ]; then + curl -# -o "$folder/Notion-zh_CN.js" "$remoteUrl" + + listLine="tail -n 1 $preloadJs" + + if [ $listLine != "require('./notion-zh_CN')" ]; then + echo "require('./notion-zh_CN')" >> $preloadJs + fi +fi \ No newline at end of file