-
Notifications
You must be signed in to change notification settings - Fork 300
Closed
Description
- Node.js Version: 10.16.3
- OS: 10
- Scope (install, code, runtime, meta, other?):
- Module (and version) (if relevant):
Is there any way to read environment variable which is set in windows like below:
This is my requirement, in here I want to read above-mentioned variables values:
tagchange.js
var fs = require('fs');
var oldtag = process.env.oldtag;
var newtag = process.env.newtag;
var glob = require('glob');
require('dotenv').config()
console.log(process.env);
var files = glob.sync('./@syncfusion/*');
for (var i = 0; i < files.length; i++) {
var sourceFile = fs.readFileSync(files[i],'utf8');
sourceFile = sourceFile.replace(`selector: '[ejs-button]'`,`selector: '[Kumar-button]'`);
// sourceFile = sourceFile.replace(oldtag,newtag);
fs.writeFileSync(files[i], sourceFile, 'utf8');
}
package.json
"dependencies": {
"postinstall": "*"
},
"scripts": {
"postinstall": "node ./tagchange.js",
"packagr": "ng-packagr -p ng-package.json && gulp npmrc-changelog-schematics-injection && gulp path-change"
}
Metadata
Metadata
Assignees
Labels
No labels