Commit 2a93316f authored by nanahira's avatar nanahira

Merge branch 'mc'

parents b2a9b8dc aa69147c
Pipeline #1270 passed with stages
in 11 minutes and 37 seconds
......@@ -101,10 +101,10 @@ checkFileExists = (path) =>
catch e
return false
createDirectoryIfNotExists = (path) =>
createDirectoryIfNotExists = (dirPath) =>
try
if path and !await checkFileExists(path)
await fs.promises.mkdir(path, {recursive: true})
if dirPath and !await checkFileExists(dirPath)
await fs.promises.mkdir(dirPath, {recursive: true})
catch e
log.warn("Failed to create directory #{path}: #{e.toString()}")
......@@ -674,8 +674,8 @@ init = () ->
settings.modules.deck_log.local
]
for path in mkdirList
await createDirectoryIfNotExists(path)
for dirPath in mkdirList
await createDirectoryIfNotExists(dirPath)
plugin_list = await fs.promises.readdir("./plugins")
for plugin_filename in plugin_list
......
......@@ -94,11 +94,11 @@
}
};
createDirectoryIfNotExists = async(path) => {
createDirectoryIfNotExists = async(dirPath) => {
var e;
try {
if (path && !(await checkFileExists(path))) {
return (await fs.promises.mkdir(path, {
if (dirPath && !(await checkFileExists(dirPath))) {
return (await fs.promises.mkdir(dirPath, {
recursive: true
}));
}
......@@ -363,7 +363,7 @@
};
init = async function() {
var AthleticChecker, DataManager, challonge_module_name, challonge_type, chat_color, config, cppversion, defaultConfig, default_data, dns, e, http_server, https, https_server, imported, j, l, len, len1, len2, m, mkdirList, options, pgClient, pg_client, pg_query, plugin_filename, plugin_list, plugin_path, postData, ref, vip_info;
var AthleticChecker, DataManager, challonge_module_name, challonge_type, chat_color, config, cppversion, defaultConfig, default_data, dirPath, dns, e, http_server, https, https_server, imported, j, l, len, len1, len2, m, mkdirList, options, pgClient, pg_client, pg_query, plugin_filename, plugin_list, plugin_path, postData, ref, vip_info;
await createDirectoryIfNotExists("./config");
await importOldConfig();
defaultConfig = (await loadJSONAsync('./data/default_config.json'));
......@@ -868,8 +868,8 @@
}
mkdirList = ["./plugins", settings.modules.tournament_mode.deck_path, settings.modules.tournament_mode.replay_path, settings.modules.tournament_mode.log_save_path, settings.modules.deck_log.local];
for (l = 0, len1 = mkdirList.length; l < len1; l++) {
path = mkdirList[l];
await createDirectoryIfNotExists(path);
dirPath = mkdirList[l];
await createDirectoryIfNotExists(dirPath);
}
plugin_list = (await fs.promises.readdir("./plugins"));
for (m = 0, len2 = plugin_list.length; m < len2; m++) {
......
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