@lvnt/release-radar 1.6.1 → 1.6.2
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/index.js +17 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { CliPublisher } from './cli-publisher.js';
|
|
|
15
15
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
16
|
const __dirname = dirname(__filename);
|
|
17
17
|
const PKG_ROOT = join(__dirname, '..'); // dist/../ = package root
|
|
18
|
+
console.log(`ReleaseRadar package root: ${PKG_ROOT}`);
|
|
18
19
|
const BOT_TOKEN = process.env.TELEGRAM_BOT_TOKEN;
|
|
19
20
|
const CHAT_ID = process.env.TELEGRAM_CHAT_ID;
|
|
20
21
|
const CONFIG_PATH = join(PKG_ROOT, 'config', 'tools.json');
|
|
@@ -25,11 +26,25 @@ if (!BOT_TOKEN || !CHAT_ID) {
|
|
|
25
26
|
// Type-safe constants after validation
|
|
26
27
|
const validatedChatId = CHAT_ID;
|
|
27
28
|
// Load config
|
|
28
|
-
|
|
29
|
+
console.log(`Loading config from: ${CONFIG_PATH}`);
|
|
30
|
+
if (!existsSync(CONFIG_PATH)) {
|
|
31
|
+
console.error(`Config file not found: ${CONFIG_PATH}`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
let configData;
|
|
35
|
+
try {
|
|
36
|
+
configData = JSON.parse(readFileSync(CONFIG_PATH, 'utf-8'));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error(`Failed to parse config: ${error}`);
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
29
42
|
const DOWNLOADS_PATH = join(PKG_ROOT, 'config', 'downloads.json');
|
|
43
|
+
console.log(`Loading downloads config from: ${DOWNLOADS_PATH}`);
|
|
30
44
|
let downloadsConfig = {};
|
|
31
45
|
try {
|
|
32
46
|
downloadsConfig = JSON.parse(readFileSync(DOWNLOADS_PATH, 'utf-8'));
|
|
47
|
+
console.log(`Loaded ${Object.keys(downloadsConfig).length} download configs`);
|
|
33
48
|
}
|
|
34
49
|
catch {
|
|
35
50
|
console.log('No downloads.json found, CLI generation disabled');
|
|
@@ -39,6 +54,7 @@ const DATA_DIR = join(PKG_ROOT, 'data');
|
|
|
39
54
|
if (!existsSync(DATA_DIR)) {
|
|
40
55
|
mkdirSync(DATA_DIR, { recursive: true });
|
|
41
56
|
}
|
|
57
|
+
console.log(`Data directory: ${DATA_DIR}`);
|
|
42
58
|
// Initialize components
|
|
43
59
|
const bot = new TelegramBot(BOT_TOKEN, { polling: true });
|
|
44
60
|
const storage = new Storage(join(DATA_DIR, 'versions.json'));
|