11import * as fs from 'fs' ;
22import * as path from 'path' ;
3- import { cliux , pathValidator , sanitizepath } from '@contentstack/cli-utilities' ;
3+ import { cliux , pathValidator , sanitizePath } from '@contentstack/cli-utilities' ;
44import { continueBootstrapCommand } from '../bootstrap/interactive' ;
55import { AppConfig } from '../config' ;
66import messageHandler from '../messages' ;
@@ -154,7 +154,7 @@ const envFileHandler = async (
154154 case 'reactjs' :
155155 case 'reactjs-starter' :
156156 fileName = `.env.${ environmentVariables . environment } .local` ;
157- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
157+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
158158 content = `REACT_APP_CONTENTSTACK_API_KEY=${
159159 environmentVariables . api_key
160160 } \nREACT_APP_CONTENTSTACK_DELIVERY_TOKEN=${ environmentVariables . deliveryToken } ${
@@ -173,7 +173,7 @@ const envFileHandler = async (
173173 case 'nextjs' :
174174 case 'nextjs-starter' :
175175 fileName = `.env.${ environmentVariables . environment } .local` ;
176- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
176+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
177177 content = `CONTENTSTACK_API_KEY=${ environmentVariables . api_key } \nCONTENTSTACK_DELIVERY_TOKEN=${
178178 environmentVariables . deliveryToken
179179 } \n${
@@ -192,7 +192,7 @@ const envFileHandler = async (
192192 case 'gatsby' :
193193 case 'gatsby-starter' :
194194 fileName = `.env.${ environmentVariables . environment } ` ;
195- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
195+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
196196 content = `CONTENTSTACK_API_KEY=${ environmentVariables . api_key } \nCONTENTSTACK_DELIVERY_TOKEN=${
197197 environmentVariables . deliveryToken
198198 } \n${
@@ -221,7 +221,7 @@ const envFileHandler = async (
221221 ! isUSRegion && ! customHost ? `,\n\t\tregion: '${ region . name } '` : ''
222222 } \n\t } \n };`;
223223 fileName = `.env${ environmentVariables . environment === 'production' ? '.prod' : '' } ` ;
224- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , 'src' , 'environments' , sanitizepath ( fileName ) ) ) ;
224+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , 'src' , 'environments' , sanitizePath ( fileName ) ) ) ;
225225 result = await writeEnvFile ( content , filePath ) ;
226226 break ;
227227 case 'angular-starter' :
@@ -239,15 +239,15 @@ const envFileHandler = async (
239239 ! isUSRegion && ! customHost ? '\nCONTENTSTACK_REGION=' + region . name : ''
240240 } \nCONTENTSTACK_LIVE_PREVIEW=${ livePreviewEnabled } \nCONTENTSTACK_LIVE_EDIT_TAGS=false`;
241241 fileName = `.env${ environmentVariables . environment === 'production' ? '.prod' : '' } ` ;
242- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
242+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
243243 result = await writeEnvFile ( content , filePath ) ;
244244 break ;
245245 case 'nuxtjs' :
246246 case 'nuxt-starter' :
247247 case 'nuxt3-starter' :
248248 case 'stencil-starter' :
249249 fileName = production ? '.env.production' : '.env' ;
250- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
250+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
251251 // Note: Stencil app needs all the env variables, even if they are not having values otherwise the rollup does not work properly and throws process in undefined error.
252252 content = `CONTENTSTACK_API_KEY=${ environmentVariables . api_key } \nCONTENTSTACK_DELIVERY_TOKEN=${
253253 environmentVariables . deliveryToken
@@ -266,7 +266,7 @@ const envFileHandler = async (
266266 break ;
267267 case 'vue-starter' :
268268 fileName = '.env' ;
269- filePath = pathValidator ( path . join ( sanitizepath ( clonedDirectory ) , sanitizepath ( fileName ) ) ) ;
269+ filePath = pathValidator ( path . join ( sanitizePath ( clonedDirectory ) , sanitizePath ( fileName ) ) ) ;
270270 content = `VUE_APP_CONTENTSTACK_API_KEY=${ environmentVariables . api_key } \nVUE_APP_CONTENTSTACK_DELIVERY_TOKEN=${
271271 environmentVariables . deliveryToken
272272 } \n${
0 commit comments