NERDDISCO commited on
Commit
8f23117
•
1 Parent(s): ae0898c

fix(write-version): use a node script to write the version

Browse files
Files changed (2) hide show
  1. package.json +1 -1
  2. scripts/write-version.js +6 -0
package.json CHANGED
@@ -29,7 +29,7 @@
29
  "dev": "next dev",
30
  "postinstall": "npm run write-version",
31
  "prepare": "husky install",
32
- "write-version": "echo 'NEXT_PUBLIC_VERSION=$(node -p \"require('./package.json').version\")' >> .env"
33
  },
34
  "lint-staged": {
35
  "*.{ts,tsx,jsx}": [
 
29
  "dev": "next dev",
30
  "postinstall": "npm run write-version",
31
  "prepare": "husky install",
32
+ "write-version": "node scripts/write-version.js"
33
  },
34
  "lint-staged": {
35
  "*.{ts,tsx,jsx}": [
scripts/write-version.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ const fs = require('fs');
2
+ const packageJson = require('../package.json');
3
+
4
+ const envVars = `NEXT_PUBLIC_VERSION=${packageJson.version}\n`;
5
+
6
+ fs.appendFileSync('.env', envVars);