PR-721144: fix npx.

This commit is contained in:
Alejandro Lembke Barrientos 2022-08-06 00:12:36 +00:00
parent f1ed56c05a
commit 29ad73f286
2 changed files with 18 additions and 22 deletions

View File

@ -30,11 +30,8 @@ const replaceTextOnFile = ({
textReplace, textReplace,
arrOfObjectsBeReplaced arrOfObjectsBeReplaced
}) => { }) => {
fs.readFile(file, 'utf8', function (err,data) { const data = fs.readFileSync(file, 'utf8');
let result let result
if (err) {
return console.error(err);
}
if(arrOfObjectsBeReplaced){ if(arrOfObjectsBeReplaced){
arrOfObjectsBeReplaced.forEach( obj => { arrOfObjectsBeReplaced.forEach( obj => {
if(result){ if(result){
@ -47,12 +44,11 @@ const replaceTextOnFile = ({
result = data.replace(textToBeReplaced, textReplace).replace(/^\s*[\r\n]/gm, ' '); result = data.replace(textToBeReplaced, textReplace).replace(/^\s*[\r\n]/gm, ' ');
} }
fs.writeFile(file, result, 'utf8', function (err) { fs.writeFileSync(file, result, 'utf8', function (err) {
if (err){ if (err){
return console.error(err); return console.error(err);
} }
}); });
});
} }
(async () => { (async () => {

View File

@ -1,6 +1,6 @@
{ {
"name": "@aleleba/create-react-ssr", "name": "@aleleba/create-react-ssr",
"version": "3.0.45", "version": "3.0.46",
"description": "Starter Kit of server side render of react", "description": "Starter Kit of server side render of react",
"bin": "./bin/cli.js", "bin": "./bin/cli.js",
"main": "src/server/index", "main": "src/server/index",