@whyour/qinglong 0.20.3 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/shell/share.sh
CHANGED
|
@@ -6,7 +6,7 @@ dir_tmp=$dir_root/.tmp
|
|
|
6
6
|
dir_data=$dir_root/data
|
|
7
7
|
|
|
8
8
|
if [[ $QL_DATA_DIR ]]; then
|
|
9
|
-
dir_data
|
|
9
|
+
dir_data="${QL_DATA_DIR%/}"
|
|
10
10
|
fi
|
|
11
11
|
|
|
12
12
|
dir_shell=$dir_root/shell
|
|
@@ -376,25 +376,25 @@ patch_version() {
|
|
|
376
376
|
|
|
377
377
|
if [[ -d "$dir_root/db" ]]; then
|
|
378
378
|
echo -e "检测到旧的db目录,拷贝到data目录...\n"
|
|
379
|
-
cp -rf $dir_root/config $
|
|
379
|
+
cp -rf $dir_root/config $dir_data
|
|
380
380
|
echo
|
|
381
381
|
fi
|
|
382
382
|
|
|
383
383
|
if [[ -d "$dir_root/scripts" ]]; then
|
|
384
384
|
echo -e "检测到旧的scripts目录,拷贝到data目录...\n"
|
|
385
|
-
cp -rf $dir_root/scripts $
|
|
385
|
+
cp -rf $dir_root/scripts $dir_data
|
|
386
386
|
echo
|
|
387
387
|
fi
|
|
388
388
|
|
|
389
389
|
if [[ -d "$dir_root/log" ]]; then
|
|
390
390
|
echo -e "检测到旧的log目录,拷贝到data目录...\n"
|
|
391
|
-
cp -rf $dir_root/log $
|
|
391
|
+
cp -rf $dir_root/log $dir_data
|
|
392
392
|
echo
|
|
393
393
|
fi
|
|
394
394
|
|
|
395
395
|
if [[ -d "$dir_root/config" ]]; then
|
|
396
396
|
echo -e "检测到旧的config目录,拷贝到data目录...\n"
|
|
397
|
-
cp -rf $dir_root/config $
|
|
397
|
+
cp -rf $dir_root/config $dir_data
|
|
398
398
|
echo
|
|
399
399
|
fi
|
|
400
400
|
}
|
package/shell/update.sh
CHANGED
|
@@ -20,11 +20,11 @@ const lastVersionFile = `https://qn.whyour.cn/version.yaml`;
|
|
|
20
20
|
const rootPath = process.env.QL_DIR;
|
|
21
21
|
const envFound = dotenv_1.default.config({ path: path_1.default.join(rootPath, '.env') });
|
|
22
22
|
let dataPath = path_1.default.join(rootPath, 'data/');
|
|
23
|
-
const shellPath = path_1.default.join(rootPath, 'shell/');
|
|
24
|
-
const tmpPath = path_1.default.join(rootPath, '.tmp/');
|
|
25
23
|
if (process.env.QL_DATA_DIR) {
|
|
26
|
-
dataPath = process.env.QL_DATA_DIR;
|
|
24
|
+
dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
|
|
27
25
|
}
|
|
26
|
+
const shellPath = path_1.default.join(rootPath, 'shell/');
|
|
27
|
+
const tmpPath = path_1.default.join(rootPath, '.tmp/');
|
|
28
28
|
const samplePath = path_1.default.join(rootPath, 'sample/');
|
|
29
29
|
const configPath = path_1.default.join(dataPath, 'config/');
|
|
30
30
|
const scriptPath = path_1.default.join(dataPath, 'scripts/');
|
|
@@ -113,17 +113,17 @@ exports.default = async () => {
|
|
|
113
113
|
}
|
|
114
114
|
if (doc.command.includes(`${config_1.default.rootPath}/log/`)) {
|
|
115
115
|
await cron_1.CrontabModel.update({
|
|
116
|
-
command: `${config_1.default.
|
|
116
|
+
command: `${config_1.default.dataPath}/log/${doc.command.replace(`${config_1.default.rootPath}/log/`, '')}`,
|
|
117
117
|
}, { where: { id: doc.id } });
|
|
118
118
|
}
|
|
119
119
|
if (doc.command.includes(`${config_1.default.rootPath}/config/`)) {
|
|
120
120
|
await cron_1.CrontabModel.update({
|
|
121
|
-
command: `${config_1.default.
|
|
121
|
+
command: `${config_1.default.dataPath}/config/${doc.command.replace(`${config_1.default.rootPath}/config/`, '')}`,
|
|
122
122
|
}, { where: { id: doc.id } });
|
|
123
123
|
}
|
|
124
124
|
if (doc.command.includes(`${config_1.default.rootPath}/db/`)) {
|
|
125
125
|
await cron_1.CrontabModel.update({
|
|
126
|
-
command: `${config_1.default.
|
|
126
|
+
command: `${config_1.default.dataPath}/db/${doc.command.replace(`${config_1.default.rootPath}/db/`, '')}`,
|
|
127
127
|
}, { where: { id: doc.id } });
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -11,7 +11,7 @@ const util_1 = require("../config/util");
|
|
|
11
11
|
const rootPath = process.env.QL_DIR;
|
|
12
12
|
let dataPath = path_1.default.join(rootPath, 'data/');
|
|
13
13
|
if (process.env.QL_DATA_DIR) {
|
|
14
|
-
dataPath = process.env.QL_DATA_DIR;
|
|
14
|
+
dataPath = process.env.QL_DATA_DIR.replace(/\/$/g, '');
|
|
15
15
|
}
|
|
16
16
|
const configPath = path_1.default.join(dataPath, 'config/');
|
|
17
17
|
const scriptPath = path_1.default.join(dataPath, 'scripts/');
|