onebots 0.4.69 → 0.4.70
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/lib/server/app.js +3 -2
- package/package.json +1 -1
package/lib/server/app.js
CHANGED
|
@@ -308,7 +308,8 @@ class App extends koa_1.default {
|
|
|
308
308
|
exports.App = App;
|
|
309
309
|
App.configDir = path.join(os.homedir(), ".onebots");
|
|
310
310
|
function createOnebots(config = "config.yaml", cp = null) {
|
|
311
|
-
|
|
311
|
+
const isStartWithConfigFile = typeof config === "string";
|
|
312
|
+
if (isStartWithConfigFile) {
|
|
312
313
|
config = path.resolve(process_1.default.cwd(), config);
|
|
313
314
|
App.configDir = path.dirname(config);
|
|
314
315
|
if (!(0, fs_1.existsSync)(App.configDir)) {
|
|
@@ -318,7 +319,7 @@ function createOnebots(config = "config.yaml", cp = null) {
|
|
|
318
319
|
}
|
|
319
320
|
if (!(0, fs_1.existsSync)(App.configPath)) {
|
|
320
321
|
(0, fs_1.copyFileSync)(path.resolve(__dirname, "../config.sample.yaml"), App.configPath);
|
|
321
|
-
if (
|
|
322
|
+
if (isStartWithConfigFile) {
|
|
322
323
|
console.log("未找到对应配置文件,已自动生成默认配置文件,请修改配置文件后重新启动");
|
|
323
324
|
console.log(`配置文件在: ${App.configPath}`);
|
|
324
325
|
process_1.default.exit();
|