mirror of
https://github.com/LightZirconite/Microsoft-Rewards-Bot.git
synced 2026-01-09 17:06:15 +00:00
fix: Update backup strategy by removing dist/ from critical files and ensuring clean rebuild
This commit is contained in:
@@ -419,7 +419,8 @@ async function performUpdate() {
|
||||
}
|
||||
|
||||
// Backup critical files for potential rollback
|
||||
const criticalFiles = ['package.json', 'package-lock.json', 'dist']
|
||||
// FIXED: Don't backup dist/ - it must be rebuilt from new source code
|
||||
const criticalFiles = ['package.json', 'package-lock.json']
|
||||
for (const file of criticalFiles) {
|
||||
const srcPath = join(process.cwd(), file)
|
||||
if (!existsSync(srcPath)) continue
|
||||
@@ -435,6 +436,16 @@ async function performUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
// CRITICAL FIX: Delete old dist/ before update to force clean rebuild
|
||||
const oldDistPath = join(process.cwd(), 'dist')
|
||||
if (existsSync(oldDistPath)) {
|
||||
try {
|
||||
rmSync(oldDistPath, { recursive: true, force: true })
|
||||
} catch {
|
||||
// Continue - build will overwrite anyway
|
||||
}
|
||||
}
|
||||
|
||||
// Step 3: Download latest code from GitHub
|
||||
process.stdout.write('📥 Downloading...')
|
||||
const repoOwner = 'Obsidian-wtf'
|
||||
|
||||
Reference in New Issue
Block a user