Spaces:
Sleeping
Sleeping
Commit ·
d529a1b
1
Parent(s): 5f1e333
create env test
Browse files- create-env.js +11 -1
create-env.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
const fs = require('fs');
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
// Construct the content of the .env file
|
| 4 |
const envContent = `
|
| 5 |
REACT_APP_GOOGLE_CLIENT_ID=${process.env.REACT_APP_GOOGLE_CLIENT_ID}
|
|
@@ -7,4 +11,10 @@ REACT_APP_FLASK_API_URL=${process.env.REACT_APP_FLASK_API_URL}
|
|
| 7 |
`;
|
| 8 |
|
| 9 |
// Write the content to the .env file
|
| 10 |
-
fs.writeFileSync('.env', envContent)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
const fs = require('fs');
|
| 2 |
|
| 3 |
+
// Log the environment variables
|
| 4 |
+
console.log('REACT_APP_GOOGLE_CLIENT_ID:', process.env.REACT_APP_GOOGLE_CLIENT_ID);
|
| 5 |
+
console.log('REACT_APP_FLASK_API_URL:', process.env.REACT_APP_FLASK_API_URL);
|
| 6 |
+
|
| 7 |
// Construct the content of the .env file
|
| 8 |
const envContent = `
|
| 9 |
REACT_APP_GOOGLE_CLIENT_ID=${process.env.REACT_APP_GOOGLE_CLIENT_ID}
|
|
|
|
| 11 |
`;
|
| 12 |
|
| 13 |
// Write the content to the .env file
|
| 14 |
+
fs.writeFileSync('.env', envContent, (err) => {
|
| 15 |
+
if (err) {
|
| 16 |
+
console.error('Error writing .env file', err);
|
| 17 |
+
} else {
|
| 18 |
+
console.log('.env file created successfully');
|
| 19 |
+
}
|
| 20 |
+
});
|