From bafc51b48a626f38cd1d1fc9eaf6ac4ea4e40502 Mon Sep 17 00:00:00 2001 From: reamd7 Date: Tue, 5 Sep 2023 10:40:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A1=A5=E5=85=85=E4=BB=8Egithub?= =?UTF-8?q?=E4=B8=AD=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_github.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 update_github.sh diff --git a/update_github.sh b/update_github.sh new file mode 100644 index 0000000..aadf7dc --- /dev/null +++ b/update_github.sh @@ -0,0 +1,15 @@ +#!/bin/sh +export ALL_PROXY="http://127.0.0.1:7890" + +folder="/Applications/Notion.app/Contents/Resources/app/renderer" +preloadJs="/Applications/Notion.app/Contents/Resources/app/renderer/preload.js" +remoteUrl="https://raw.githubusercontent.com/Reamd7/notion-zh_CN/main/notion-zh_CN.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