File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,20 @@ const FtpDeploy = require("ftp-deploy");
77const ftpDeploy = new FtpDeploy ( ) ;
88const cwd = process . cwd ( ) ;
99const projectJson = require ( cwd + '/package.json' ) ;
10+ const deployJson = require ( '../package.json' ) ;
11+ const envFilename = '.env.local' ;
1012
1113// load configuration from .env.local file
12- require ( 'dotenv' ) . config ( { path : cwd + '/.env.local' } ) ;
14+ require ( 'dotenv' ) . config ( { path : cwd + '/' + envFilename } ) ;
1315
14- console . log ( chalk . bgYellow ( chalk . black ( `- DEPLOY PROJECT ${ projectJson . name } -` ) ) ) ;
16+ console . log ( chalk . bgMagenta ( chalk . black ( `- ${ deployJson . name } version: ${ deployJson . version } -` ) ) ) ;
17+ console . log ( chalk . bgYellow ( chalk . black ( `DEPLOY PROJECT ${ projectJson . name } ` ) ) ) ;
18+
19+ // check if configuration is defined
20+ if ( ! process . env . DSDEPLOY_FTP_USER || ! process . env . DSDEPLOY_FTP_HOST ) {
21+ console . error ( chalk . red ( `Configuration not found in ${ cwd } /${ envFilename } ` ) ) ;
22+ process . exit ( 1 ) ;
23+ }
1524
1625// build project
1726console . log ( chalk . cyan ( '\nBuilding project...' ) ) ;
@@ -71,4 +80,6 @@ ftpDeploy
7180
7281 // delete build
7382 deleteBuild ( ) ;
83+
84+ process . exit ( 1 ) ;
7485 } ) ;
You can’t perform that action at this time.
0 commit comments