mirror of
https://github.com/whyour/qinglong.git
synced 2026-06-13 06:16:12 +08:00
fix: cd to script's directory for absolute paths in run_normal
This commit is contained in:
parent
b43bd61ac6
commit
7b924483e7
|
|
@ -18,13 +18,8 @@ const scriptPath = path.join(dataPath, 'scripts/');
|
|||
const logPath = path.join(dataPath, 'log/');
|
||||
const uploadPath = path.join(dataPath, 'upload/');
|
||||
const bakPath = path.join(dataPath, 'bak/');
|
||||
const dbPath = path.join(dataPath, 'db/');
|
||||
const repoPath = path.join(dataPath, 'repo/');
|
||||
const rawPath = path.join(dataPath, 'raw/');
|
||||
const dependenceCachePath = path.join(dataPath, 'dep_cache/');
|
||||
const samplePath = path.join(rootPath, 'sample/');
|
||||
const tmpPath = path.join(logPath, '.tmp/');
|
||||
const updateLogPath = path.join(logPath, 'update/');
|
||||
const confFile = path.join(configPath, 'config.sh');
|
||||
const sampleConfigFile = path.join(samplePath, 'config.sample.sh');
|
||||
const sampleTaskShellFile = path.join(samplePath, 'task.sample.sh');
|
||||
|
|
@ -49,16 +44,11 @@ const directories = [
|
|||
preloadPath,
|
||||
logPath,
|
||||
tmpPath,
|
||||
updateLogPath,
|
||||
uploadPath,
|
||||
sshPath,
|
||||
bakPath,
|
||||
sshdPath,
|
||||
systemLogPath,
|
||||
dbPath,
|
||||
repoPath,
|
||||
rawPath,
|
||||
dependenceCachePath,
|
||||
];
|
||||
|
||||
const files = [
|
||||
|
|
@ -114,7 +104,7 @@ const files = [
|
|||
export default async () => {
|
||||
for (const dirPath of directories) {
|
||||
if (!(await fileExist(dirPath))) {
|
||||
await fs.mkdir(dirPath, { recursive: true });
|
||||
await fs.mkdir(dirPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ run_normal() {
|
|||
if [[ ${file_param} != /* ]] && [[ ! -z ${relative_path} ]] && [[ ${file_param} =~ "/" ]]; then
|
||||
cd ${relative_path}
|
||||
file_param=${file_param/$relative_path\//}
|
||||
elif [[ ${file_param} == /* ]] && [[ ! -z ${relative_path} ]]; then
|
||||
cd ${relative_path}
|
||||
fi
|
||||
|
||||
if [[ $isJsOrPythonFile == 'false' ]]; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user