git-contributor
Advanced tools
Comparing version 1.0.11 to 1.1.0
@@ -28,13 +28,16 @@ #!/usr/bin/env node | ||
if (options.markdown) { | ||
const readmeFile = path.join(process.cwd(), 'README.md'); | ||
if (_.isExistedFile(readmeFile)) { | ||
let readmeContent = fs.readFileSync(readmeFile, 'utf8'); | ||
const reg = new RegExp(`${res.startToken}[^]*${res.endToken}`); | ||
if (reg.test(readmeContent)) { | ||
readmeContent = readmeContent.replace(reg, res.content); | ||
} else { | ||
readmeContent += res.content; | ||
const readmes = [ 'README.md', 'readme.md', 'README.zh-CN.md' ]; | ||
readmes.forEach(readmeName => { | ||
const readmeFile = path.join(process.cwd(), readmeName); | ||
if (_.isExistedFile(readmeFile)) { | ||
let readmeContent = fs.readFileSync(readmeFile, 'utf8'); | ||
const reg = new RegExp(`${res.startToken}[^]*${res.endToken}`); | ||
if (reg.test(readmeContent)) { | ||
readmeContent = readmeContent.replace(reg, res.content); | ||
} else { | ||
readmeContent += res.content; | ||
} | ||
fs.writeFileSync(readmeFile, readmeContent); | ||
} | ||
fs.writeFileSync(readmeFile, readmeContent); | ||
} | ||
}); | ||
} | ||
@@ -41,0 +44,0 @@ if (options.print) { |
{ | ||
"name": "git-contributor", | ||
"version": "1.0.11", | ||
"version": "1.1.0", | ||
"description": "git contributor", | ||
@@ -12,4 +12,5 @@ "keywords": [ | ||
"files": [ | ||
"bin/**/*.js", | ||
"lib/**/*.js" | ||
"bin", | ||
"lib", | ||
"index.js" | ||
], | ||
@@ -16,0 +17,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11609
7
206
2