OverviewFilesCommitsIssuesDocsReleasesPeers

wirecore commits / da362dd

Add optional destination parameter to migrate-storage
- Allow specifying custom destination path for migration - Default to current storage path if not specified - Update help text and examples This allows migrating to production storage path from dev mode. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
da362dd50185d2c4fafdfd66239af686125169ee
by plankatron <fleeky@gmail.com> · 2026-01-21T14:38:53.000Z

Changed files (1) +11 -9

pear-app/index.js +11 -9
……@@ -600,18 +600,20 @@ async function cmdProfile(pubkey) {
600600/**
601601 * Migrate storage from local directory to production path
602602 */
603async function cmdMigrateStorage(sourcePath) {
603async function cmdMigrateStorage(sourcePath, destPath) {
604604 if (!sourcePath) {
605 console.error('❌ Usage: cli migrate-storage <source-path>')
606 console.log('\nExample:')
605 console.error('❌ Usage: cli migrate-storage <source-path> [dest-path]')
606 console.log('\nExamples:')
607607 console.log(' cli migrate-storage ./wirecore-storage')
608 console.log('\nThis will copy data from source to current storage path:', STORAGE_PATH)
608 console.log(' cli migrate-storage ./wirecore-storage ~/.config/pear/app-storage/by-dkey/...')
609 console.log('')
610 console.log('If dest-path is not specified, uses current storage path:', STORAGE_PATH)
609611 return
610612 }
611613
612614 // Resolve paths
613615 const source = path.resolve(sourcePath)
614 const dest = path.resolve(STORAGE_PATH)
616 const dest = destPath ? path.resolve(destPath) : path.resolve(STORAGE_PATH)
615617
616618 console.log('📦 Storage Migration')
617619 console.log(' Source:', source)
……@@ -1329,7 +1331,7 @@ function showUsage() {
13291331 console.log(' pear run . cli directory [query] Search user directory')
13301332 console.log(' pear run . cli profile <pubkey> View user profile')
13311333 console.log(' pear run . cli storage-path Show current storage location')
1332 console.log(' pear run . cli migrate-storage <path> Migrate data from another storage')
1334 console.log(' pear run . cli migrate-storage <source> [dest] Migrate storage data')
13331335 console.log('')
13341336 console.log('Examples:')
13351337 console.log(' pear run . web 3003')
……@@ -1343,8 +1345,8 @@ function showUsage() {
13431345 console.log(' # Check current storage location')
13441346 console.log(' pear run . cli storage-path')
13451347 console.log('')
1346 console.log(' # Migrate from local dev storage to production')
1347 console.log(' pear run . cli migrate-storage ./wirecore-storage')
1348 console.log(' # Migrate from local storage to specific destination')
1349 console.log(' pear run . cli migrate-storage ./wirecore-storage ~/.config/pear/app-storage/by-dkey/...')
13481350}
13491351
13501352/**
……@@ -1431,7 +1433,7 @@ async function main() {
14311433 break
14321434
14331435 case 'migrate-storage':
1434 await cmdMigrateStorage(cmdParams[0])
1436 await cmdMigrateStorage(cmdParams[0], cmdParams[1])
14351437 break
14361438
14371439 default: