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) => ...@@ -101,10 +101,10 @@ checkFileExists = (path) =>
catch e catch e
return false return false
createDirectoryIfNotExists = (path) => createDirectoryIfNotExists = (dirPath) =>
try try
if path and !await checkFileExists(path) if dirPath and !await checkFileExists(dirPath)
await fs.promises.mkdir(path, {recursive: true}) await fs.promises.mkdir(dirPath, {recursive: true})
catch e catch e
log.warn("Failed to create directory #{path}: #{e.toString()}") log.warn("Failed to create directory #{path}: #{e.toString()}")
...@@ -674,8 +674,8 @@ init = () -> ...@@ -674,8 +674,8 @@ init = () ->
settings.modules.deck_log.local settings.modules.deck_log.local
] ]
for path in mkdirList for dirPath in mkdirList
await createDirectoryIfNotExists(path) await createDirectoryIfNotExists(dirPath)
plugin_list = await fs.promises.readdir("./plugins") plugin_list = await fs.promises.readdir("./plugins")
for plugin_filename in plugin_list for plugin_filename in plugin_list
......
...@@ -94,11 +94,11 @@ ...@@ -94,11 +94,11 @@
} }
}; };
createDirectoryIfNotExists = async(path) => { createDirectoryIfNotExists = async(dirPath) => {
var e; var e;
try { try {
if (path && !(await checkFileExists(path))) { if (dirPath && !(await checkFileExists(dirPath))) {
return (await fs.promises.mkdir(path, { return (await fs.promises.mkdir(dirPath, {
recursive: true recursive: true
})); }));
} }
...@@ -363,7 +363,7 @@ ...@@ -363,7 +363,7 @@
}; };
init = async function() { 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 createDirectoryIfNotExists("./config");
await importOldConfig(); await importOldConfig();
defaultConfig = (await loadJSONAsync('./data/default_config.json')); defaultConfig = (await loadJSONAsync('./data/default_config.json'));
...@@ -868,8 +868,8 @@ ...@@ -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]; 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++) { for (l = 0, len1 = mkdirList.length; l < len1; l++) {
path = mkdirList[l]; dirPath = mkdirList[l];
await createDirectoryIfNotExists(path); await createDirectoryIfNotExists(dirPath);
} }
plugin_list = (await fs.promises.readdir("./plugins")); plugin_list = (await fs.promises.readdir("./plugins"));
for (m = 0, len2 = plugin_list.length; m < len2; m++) { 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