File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,18 +6,19 @@ import { ui } from '../ui.js';
66
77export async function cmdEnv (
88 cwd : string ,
9- options : { config ?: string } ,
9+ options : { file ?: string ; config ?: string } ,
1010) : Promise < void > {
1111 await runRemoteCommand (
1212 cwd ,
1313 async ( { config, executor } ) => {
14- const localEnvPath = resolve ( cwd , config . envFile ) ;
14+ const envFile = options . file ?? config . envFile ;
15+ const localEnvPath = resolve ( cwd , envFile ) ;
1516
1617 if ( ! ( await pathExists ( localEnvPath ) ) ) {
17- throw new Error ( `Environment file not found: ${ config . envFile } ` ) ;
18+ throw new Error ( `Environment file not found: ${ envFile } ` ) ;
1819 }
1920
20- ui . info ( `Uploading ${ config . envFile } to server...` ) ;
21+ ui . info ( `Uploading ${ envFile } to server...` ) ;
2122
2223 const content = await readFile ( localEnvPath ) ;
2324 const b64 = content . toString ( 'base64' ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ ${chalk.bold('RELEASE MANAGEMENT')}
2020 ${ chalk . green ( 'migrate' ) } Migrate existing deploy to zero-downtime structure
2121
2222${ chalk . bold ( 'ENVIRONMENT' ) }
23- ${ chalk . green ( 'env' ) } Upload local .env file to the server
23+ ${ chalk . green ( 'env' ) } [--file <p>] Upload local .env file to the server
2424 ${ chalk . green ( 'run' ) } <cmd> Run a one-off command on the production server
2525
2626${ chalk . bold ( 'PROCESS MANAGEMENT' ) }
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ program
8888program
8989 . command ( 'env' )
9090 . description ( 'Upload local .env file to the server' )
91+ . option ( '--file <path>' , 'Path to .env file to upload (default: .env from config)' )
9192 . option ( '--config <path>' , 'Use a specific config file' )
9293 . action ( ( opts ) => cmdEnv ( process . cwd ( ) , opts ) ) ;
9394
You can’t perform that action at this time.
0 commit comments