File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,15 @@ const t = d.getTime();
2525// }
2626
2727const output = execSync ( "yarn info next --name-only" ) . toString ( ) . trim ( ) ;
28+
29+ console . log ( 'yarn info next output:' ) ;
30+ console . log ( output ) ;
31+
2832const versionRegex = new RegExp ( ":(?<version>(?:\\d+|\\.)+)" ) ;
2933const result = versionRegex . exec ( output . toString ( ) ) ;
30- const nextJsVersion = result ? result . groups . version : "Unknown" ;
34+ const nextJsVersion = result ? result [ 1 ] : "Unknown" ;
35+
36+ console . log ( `Extracted Next.js version: ${ nextJsVersion } ` ) ;
3137
3238const envContent = `
3339NEXT_PUBLIC_BUILD_DATETIME="${ buildDate } ${ buildTime } "
@@ -41,6 +47,9 @@ NEXT_PUBLIC_NODE_VERSION="${process.version}"
4147NEXT_PUBLIC_NEXTJS_VERSION="${ nextJsVersion } "
4248` ;
4349
50+ console . log ( '.env file contents:' ) ;
51+ console . log ( envContent ) ;
52+
4453fs . writeFileSync ( '.env' , envContent . trim ( ) ) ;
4554
4655console . log ( 'Created .env file successfully' ) ;
You can’t perform that action at this time.
0 commit comments