diff --git a/code/utils/deploy-pokedex.js b/code/utils/deploy-pokedex.js index 006f306..34b646a 100644 --- a/code/utils/deploy-pokedex.js +++ b/code/utils/deploy-pokedex.js @@ -282,6 +282,7 @@ async function deploy() { ); throw new Error(`SSH connection failed: ${connError.message}`); } + } // Build Vue 3 application console.log('\n🔨 Building Vue 3 application...'); @@ -316,6 +317,11 @@ async function deploy() { throw new Error(`Build failed: ${error.message}`); } + if (isLocal) { + await deployLocal(config); + return; + } + // Check if container exists and capture current image console.log('\n📦 Checking for existing container...'); console.log(` Container name: ${CONTAINER_NAME}`); @@ -565,6 +571,10 @@ async function deploy() { ssh.dispose(); } catch (error) { + if (config && config.target === 'local') { + console.error('\n❌ Deployment failed:', error.message); + process.exit(1); + } console.error('\n❌ Deployment failed:', error.message); // Rollback