Commit 91ce5003 authored by nanahira's avatar nanahira

fix mkdir

parent 12055d02
Pipeline #1246 passed with stage
in 6 minutes and 59 seconds
......@@ -100,8 +100,11 @@ checkFileExists = (path) =>
return false
createDirectoryIfNotExists = (path) =>
if !await checkFileExists(path)
await fs.promises.mkdir(path, {recursive: true})
try
if path and !await checkFileExists(path)
await fs.promises.mkdir(path, {recursive: true})
catch e
log.warn("Failed to create directory #{path}: #{e.toString()}")
setting_save = global.setting_save = (settings) ->
try
......
......@@ -95,10 +95,16 @@
};
createDirectoryIfNotExists = async(path) => {
if (!(await checkFileExists(path))) {
return (await fs.promises.mkdir(path, {
recursive: true
}));
var e;
try {
if (path && !(await checkFileExists(path))) {
return (await fs.promises.mkdir(path, {
recursive: true
}));
}
} catch (error1) {
e = error1;
return log.warn(`Failed to create directory ${path}: ${e.toString()}`);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment