@lvnt/release-radar 1.7.11 → 1.7.12
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 +10 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { config } from 'dotenv';
|
|
|
3
3
|
config();
|
|
4
4
|
import TelegramBot from 'node-telegram-bot-api';
|
|
5
5
|
import cron from 'node-cron';
|
|
6
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, cpSync } from 'fs';
|
|
6
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, cpSync, rmSync } from 'fs';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { dirname, join } from 'path';
|
|
9
9
|
import { Storage } from './storage.js';
|
|
@@ -65,11 +65,7 @@ const PKG_CLI_DIR = join(PKG_ROOT, 'cli');
|
|
|
65
65
|
const USER_CLI_DIR = join(DATA_DIR, 'cli');
|
|
66
66
|
console.log(`Syncing CLI source from ${PKG_CLI_DIR} to ${USER_CLI_DIR}...`);
|
|
67
67
|
if (existsSync(PKG_CLI_DIR)) {
|
|
68
|
-
//
|
|
69
|
-
if (!existsSync(USER_CLI_DIR)) {
|
|
70
|
-
mkdirSync(USER_CLI_DIR, { recursive: true });
|
|
71
|
-
}
|
|
72
|
-
// Sync source files (excluding node_modules which is installed separately)
|
|
68
|
+
// Sync source files (excluding node_modules and dist which are generated)
|
|
73
69
|
const filesToSync = ['src', 'bin', 'package.json', 'tsconfig.json', 'README.md'];
|
|
74
70
|
let syncedCount = 0;
|
|
75
71
|
for (const file of filesToSync) {
|
|
@@ -77,7 +73,14 @@ if (existsSync(PKG_CLI_DIR)) {
|
|
|
77
73
|
const destPath = join(USER_CLI_DIR, file);
|
|
78
74
|
if (existsSync(srcPath)) {
|
|
79
75
|
try {
|
|
80
|
-
|
|
76
|
+
// Remove existing destination first to ensure clean copy
|
|
77
|
+
if (existsSync(destPath)) {
|
|
78
|
+
rmSync(destPath, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
// Ensure parent directory exists
|
|
81
|
+
mkdirSync(USER_CLI_DIR, { recursive: true });
|
|
82
|
+
// Copy fresh
|
|
83
|
+
cpSync(srcPath, destPath, { recursive: true });
|
|
81
84
|
syncedCount++;
|
|
82
85
|
}
|
|
83
86
|
catch (err) {
|