update .env writing

This commit is contained in:
2025-12-04 15:04:28 -05:00
parent 6e04dc1c74
commit 690015aa40
2 changed files with 22 additions and 4 deletions

View File

@@ -25,10 +25,14 @@ jobs:
- name: Create production .env file
working-directory: electron-app
run: |
echo "WS_URL=${{ secrets.WS_URL }}" > .env
echo "API_URL=${{ secrets.API_URL }}" >> .env
echo "NODE_ENV=production" >> .env
env:
WS_URL: ${{ secrets.WS_URL }}
API_URL: ${{ secrets.API_URL }}
run: node scripts/create-env.cjs
- name: Verify .env file
working-directory: electron-app
run: type .env
- name: Build TypeScript
working-directory: electron-app

View File

@@ -0,0 +1,14 @@
const fs = require('fs');
const path = require('path');
const envPath = path.join(__dirname, '..', '.env');
const content = `WS_URL=${process.env.WS_URL || ''}
API_URL=${process.env.API_URL || ''}
NODE_ENV=production
`;
fs.writeFileSync(envPath, content, 'utf8');
console.log('.env file created at:', envPath);
console.log('Contents:');
console.log(content);