reciple 6.0.0-dev.16 → 6.0.0-dev.17
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/dist/lib/bin.mjs +2 -2
- package/dist/lib/reciple/classes/RecipleClient.js +1 -0
- package/dist/lib/reciple/classes/RecipleConfig.js +1 -1
- package/dist/lib/reciple/classes/managers/ClientModuleManager.js +1 -2
- package/dist/types/reciple/classes/RecipleClient.d.ts +2 -0
- package/package.json +1 -1
- package/resource/reciple.yml +3 -1
package/dist/lib/bin.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import 'dotenv/config';
|
|
|
10
10
|
import path from 'path';
|
|
11
11
|
import { inspect } from 'util';
|
|
12
12
|
const allowedFiles = ['node_modules', 'reciple.yml', 'package.json'];
|
|
13
|
-
const configPath = path.join(cwd, '
|
|
13
|
+
const configPath = path.join(cwd, 'reciple.yml');
|
|
14
14
|
if (readdirSync(cwd).filter(f => !f.startsWith('.') && allowedFiles.indexOf(f)).length > 0 && !existsSync(flags.config ?? configPath)) {
|
|
15
15
|
const ask = (flags.yes ? 'y' : null) ?? input('This directory does not contain reciple.yml. Would you like to init axis here? [y/n] ') ?? '';
|
|
16
16
|
if (ask.toString().toLowerCase() !== 'y')
|
|
@@ -25,7 +25,7 @@ catch (err) {
|
|
|
25
25
|
process.exit(1);
|
|
26
26
|
}
|
|
27
27
|
const config = configParser.getConfig();
|
|
28
|
-
const client = new RecipleClient({ config: config, ...config.client });
|
|
28
|
+
const client = new RecipleClient({ config: config, cwd, ...config.client });
|
|
29
29
|
/**
|
|
30
30
|
* Start
|
|
31
31
|
*/
|
|
@@ -40,6 +40,7 @@ class RecipleClient extends discord_js_1.Client {
|
|
|
40
40
|
this.config = { ...this.config, ...(options.config ?? {}) };
|
|
41
41
|
if (this.config.fileLogging.enabled)
|
|
42
42
|
this.logger.logFile(path_1.default.join(flags_1.cwd, this.config.fileLogging.logFilePath ?? 'logs/latest.log'), false);
|
|
43
|
+
this.cwd = options.cwd ?? process.cwd();
|
|
43
44
|
this.applicationCommands = new ApplicationCommandManager_1.ApplicationCommandManager(this);
|
|
44
45
|
}
|
|
45
46
|
get isClientLogsSilent() {
|
|
@@ -19,7 +19,7 @@ class RecipleConfig {
|
|
|
19
19
|
*/
|
|
20
20
|
constructor(configPath) {
|
|
21
21
|
this.config = RecipleConfig.getDefaultConfig();
|
|
22
|
-
this.configPath = path_1.default.join(
|
|
22
|
+
this.configPath = path_1.default.join(process.cwd(), 'reciple.yml');
|
|
23
23
|
if (!configPath)
|
|
24
24
|
throw new Error('Config path is not defined');
|
|
25
25
|
this.configPath = configPath;
|
|
@@ -9,7 +9,6 @@ const fs_1 = require("fs");
|
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const util_1 = require("util");
|
|
11
11
|
const wildcard_match_1 = __importDefault(require("wildcard-match"));
|
|
12
|
-
const flags_1 = require("../../flags");
|
|
13
12
|
const RecipleModule_1 = require("../RecipleModule");
|
|
14
13
|
class ClientModuleManager {
|
|
15
14
|
constructor(options) {
|
|
@@ -175,7 +174,7 @@ class ClientModuleManager {
|
|
|
175
174
|
if (!(0, fs_1.lstatSync)(dir).isDirectory())
|
|
176
175
|
continue;
|
|
177
176
|
modules.push(...(0, fs_1.readdirSync)(dir)
|
|
178
|
-
.map(file => path_1.default.join(
|
|
177
|
+
.map(file => path_1.default.join(!dir.startsWith('/') ? this.client.cwd : '', dir, file))
|
|
179
178
|
.filter(file => (options?.filter ? options.filter(file) : file.endsWith('.js'))));
|
|
180
179
|
}
|
|
181
180
|
return modules.filter(file => !(options?.ignoredFiles ?? this.client.config.ignoredFiles).some(ignored => (0, wildcard_match_1.default)(ignored)(path_1.default.basename(file))));
|
|
@@ -13,6 +13,7 @@ import { Logger } from 'fallout-utility';
|
|
|
13
13
|
*/
|
|
14
14
|
export interface RecipleClientOptions extends ClientOptions {
|
|
15
15
|
config?: Config;
|
|
16
|
+
cwd?: string;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
19
|
* Reciple client events
|
|
@@ -45,6 +46,7 @@ export declare class RecipleClient<Ready extends boolean = boolean> extends Clie
|
|
|
45
46
|
readonly applicationCommands: ApplicationCommandManager;
|
|
46
47
|
readonly cooldowns: CommandCooldownManager;
|
|
47
48
|
readonly modules: ClientModuleManager;
|
|
49
|
+
readonly cwd: string;
|
|
48
50
|
readonly logger: Logger;
|
|
49
51
|
readonly version: string;
|
|
50
52
|
get isClientLogsSilent(): boolean;
|
package/package.json
CHANGED