File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -732,7 +732,7 @@ const richieRich: Prisma.UserCreateInput = {
732732 firstName : 'Richie' ,
733733 lastName : 'Rich' ,
734734 email : 'richerich@harveycomics.com' ,
735- role : Role . ADMIN ,
735+ role : Role . LEADERSHIP ,
736736 googleAuthId : 'rich' ,
737737 userSettings : {
738738 create : {
Original file line number Diff line number Diff line change @@ -199,6 +199,20 @@ const performSeed: () => Promise<void> = async () => {
199199 const plLegends : Team = await prisma . team . create ( dbSeedAllTeams . plLegends ( cristianoRonaldo . userId ) ) ;
200200 const financeTeam : Team = await prisma . team . create ( dbSeedAllTeams . financeTeam ( monopolyMan . userId ) ) ;
201201
202+ /** Gets the current content of the .env file */
203+ const currentEnv = require ( 'dotenv' ) . config ( ) . parsed ;
204+
205+ /** If the .env file exists, set the FINANCE_TEAM_ID */
206+ if ( currentEnv ) {
207+ currentEnv . FINANCE_TEAM_ID = financeTeam ;
208+ /** Write the new .env file */
209+ let stringifiedEnv = '' ;
210+ Object . keys ( currentEnv ) . forEach ( ( key ) => {
211+ stringifiedEnv += `${ key } =${ currentEnv [ key ] } \n` ;
212+ } ) ;
213+ writeFileSync ( '.env' , stringifiedEnv ) ;
214+ }
215+
202216 /** Setting Team Members */
203217 await TeamsService . setTeamMembers (
204218 batman ,
You can’t perform that action at this time.
0 commit comments