From 5a7e8e2ad9fc10e36304fb611f1c8061ebee90b3 Mon Sep 17 00:00:00 2001 From: Leon Date: Wed, 11 Aug 2021 20:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1FN=5Fextend.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Scripts/js/FN_extend.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Scripts/js/FN_extend.js diff --git a/Scripts/js/FN_extend.js b/Scripts/js/FN_extend.js new file mode 100644 index 0000000..c24d477 --- /dev/null +++ b/Scripts/js/FN_extend.js @@ -0,0 +1,35 @@ +// @grant nodejs +console.log("⏳ 初始化安装依赖中......") +$exec('wget https://raw.githubusercontent.com/Oreomeow/freenom-py/main/requirements.txt -O requirements.txt && pip3 install -r requirements.txt', { + cwd: './script/Shell', + timeout: 0, + cb(data, error) { + error ? console.error(error) : console.log(data) + } +}) +console.log("⏳ 开始拉取 git 仓库 Oreomeow/freenom-py") +$exec('git clone https://github.com/Oreomeow/freenom-py.git', { + cwd: './script/Shell', + timeout: 0, + cb(data, error) { + error ? console.error(error) : console.log(data) + } +}) +console.log("⏳ 开始执行 FN_extend.py") +$exec('python3 FN_extend.py', { + cwd: './script/Shell/freenom-py', + timeout: 0, + env: { + FN_ID: $store.get('FN_ID', 'string'), + FN_PW: $store.get('FN_PW', 'string'), + MAIL_USER: $store.get('MAIL_USER', 'string'), + MAIL_ADDRESS: $store.get('MAIL_ADDRESS', 'string'), + MAIL_PW: $store.get('MAIL_PW', 'string'), + MAIL_HOST: $store.get('MAIL_HOST', 'string'), + MAIL_PORT: $store.get('MAIL_PORT', 'string'), + MAIL_TO: $store.get('MAIL_TO', 'string'), + }, + cb(data, error) { + error ? console.error(error) : console.log(data) + } +}) \ No newline at end of file