This repository was archived by the owner on Dec 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -105,4 +105,15 @@ export class Helpers {
105105 } ) ;
106106} ) ;
107107 }
108+
109+ static createDir ( dir : string ) {
110+ const fs = require ( "fs" )
111+ try {
112+ if ( ! fs . existsSync ( dir ) ) {
113+ fs . mkdirSync ( dir ) ;
114+ }
115+ } catch ( e ) {
116+ console . log ( "createDir: An error occurred." + e )
117+ }
118+ }
108119}
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ export class CreateStackCommand extends Command {
109109 appconfig . readOnly = flags . readonly ;
110110 appconfig . enableSwagger = flags . swagger ;
111111 appconfig . stackName = stackName ;
112+ Helpers . createDir ( stackFolder + "/config" ) ;
112113 fs . writeFileSync (
113114 path . normalize ( stackFolder + '/config/appconfig.json' ) ,
114115 JSON . stringify ( appconfig , null , 2 ) ,
@@ -122,6 +123,7 @@ export class CreateStackCommand extends Command {
122123 const serverlessConfig = new ServerlessConfig ( ) ;
123124 serverlessConfig . awsRegion = region ;
124125 serverlessConfig . stage = args . stage ;
126+ Helpers . createDir ( stackFolder + "/config" ) ;
125127 fs . writeFileSync (
126128 path . normalize ( stackFolder + '/config/serverlessconfig.json' ) ,
127129 JSON . stringify ( serverlessConfig , null , 2 ) ,
You can’t perform that action at this time.
0 commit comments