Comparing version 1.0.2 to 1.0.3
@@ -30,5 +30,4 @@ #!/usr/bin/env node | ||
} | ||
console.log(output) | ||
}) | ||
{ | ||
"name": "branchinfo", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "给git分支加注释,来清晰的记录git分支的作用", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const fs = require('fs') | ||
const path = require('path') | ||
let git_branch = '' | ||
let currentPath = process.cwd() | ||
while(currentPath !== '/') { | ||
if(fs.existsSync(path.resolve(currentPath, '.gitbranch'))) { | ||
break | ||
} else { | ||
currentPath = path.resolve(currentPath, '../') | ||
} | ||
} | ||
try { | ||
git_branch = fs.readFileSync('./.gitbranch').toString() | ||
git_branch = fs.readFileSync(path.resolve(currentPath, '.gitbranch')).toString() | ||
} catch(e) { | ||
@@ -7,0 +18,0 @@ if(e.code === 'ENOENT') { |
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
4415
52