mirror of
https://github.com/whyour/qinglong.git
synced 2025-08-24 21:36:09 +08:00
修复执行 task_before 环境变量加载顺序
This commit is contained in:
parent
be2da98674
commit
fe4516df00
|
@ -1,13 +1,5 @@
|
||||||
const { execSync } = require('child_process');
|
const { execSync } = require('child_process');
|
||||||
const { sendNotify } = require('./notify.js');
|
|
||||||
require(`./env.js`);
|
require(`./env.js`);
|
||||||
|
|
||||||
function initGlobal() {
|
|
||||||
global.QLAPI = {
|
|
||||||
notify: sendNotify,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function expandRange(rangeStr, max) {
|
function expandRange(rangeStr, max) {
|
||||||
const tempRangeStr = rangeStr
|
const tempRangeStr = rangeStr
|
||||||
.trim()
|
.trim()
|
||||||
|
@ -76,8 +68,12 @@ function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initGlobal();
|
|
||||||
run();
|
run();
|
||||||
|
|
||||||
|
const { sendNotify } = require('./notify.js');
|
||||||
|
global.QLAPI = {
|
||||||
|
notify: sendNotify,
|
||||||
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`run builtin code error: `, error, '\n');
|
console.log(`run builtin code error: `, error, '\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,6 @@ import json
|
||||||
import builtins
|
import builtins
|
||||||
import sys
|
import sys
|
||||||
import env
|
import env
|
||||||
from notify import send
|
|
||||||
|
|
||||||
|
|
||||||
class BaseApi:
|
|
||||||
def notify(self, *args, **kwargs):
|
|
||||||
return send(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def init_global():
|
|
||||||
QLAPI = BaseApi()
|
|
||||||
builtins.QLAPI = QLAPI
|
|
||||||
|
|
||||||
|
|
||||||
def try_parse_int(value):
|
def try_parse_int(value):
|
||||||
|
@ -92,7 +81,15 @@ def run():
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
init_global()
|
|
||||||
run()
|
run()
|
||||||
|
|
||||||
|
from notify import send
|
||||||
|
|
||||||
|
class BaseApi:
|
||||||
|
def notify(self, *args, **kwargs):
|
||||||
|
return send(*args, **kwargs)
|
||||||
|
|
||||||
|
QLAPI = BaseApi()
|
||||||
|
builtins.QLAPI = QLAPI
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print(f"run builtin code error: {error}\n")
|
print(f"run builtin code error: {error}\n")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user