build-ignore
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "build-ignore", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A post-checkout hook script that generates a .gitignore based on branch name for when different .gitignores are needed", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ #!/usr/bin/env node | ||
const regEx = /ref: refs\/heads\/([^\n]+)/; | ||
const gitBranch = function(branch) { | ||
const gitBranch = function(branch = publish) { | ||
console.log(branch); | ||
@@ -17,9 +17,8 @@ fs.readFile(`${path.join(process.cwd(), '.git/HEAD')}`, 'utf8', (err, data) => { | ||
if (match[1] === branch) { | ||
console.log('Shit is legit yoooooo', match[1]); | ||
fs.readFile(path.join(process.cwd(),'gitignores/gitignore_publish.txt'), 'utf8', (err, data) => { | ||
fs.readFile(path.join(process.cwd(), `gitignores/gitignore_${branch}.txt`), 'utf8', (err, data) => { | ||
fs.writeFile('./.gitignore', data, (err) => { | ||
if (err) throw err; | ||
console.log('It\'s saved!'); | ||
console.log('Something is went wrong!!'); | ||
}); | ||
console.log('DATA', data); | ||
console.log('New .gitignore created: ', data); | ||
}); | ||
@@ -26,0 +25,0 @@ } else { |
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
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
1726
36