[replace] [m]: create main file to replace content

This commit is contained in:
Thadeu Cotts 2020-11-26 15:06:36 -03:00
parent 84d341a91f
commit 814f091131

View File

@ -0,0 +1,21 @@
const fs = require('fs');
const path = require("path");
const {parserPath } = require('./copy')
function _replacePackage(projectName){
const appPath = parserPath(projectName)
const packagePath = `${appPath}/package.json`
const data = JSON.parse(fs.readFileSync(packagePath, 'utf8'))
data.name = projectName
delete data.homepage
fs.writeFileSync(packagePath, JSON.stringify(data, null, 2))
}
function replaceContent(projectName){
_replacePackage(projectName)
}
module.exports = replaceContent