Skip to content

Commit

Permalink
Potential bug in name discovery fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
inossidabile committed Nov 9, 2013
1 parent 0f3427e commit e14fb21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/codo.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ module.exports = Codo =
if FS.existsSync(Path.join path, 'package.json')
name = JSON.parse(FS.readFileSync Path.join(path, 'package.json'), 'utf-8')['name']

else if FS.existsSync(Path.join path, '.git', 'config')
config = fs.readFileSync(Path.join(path, '.git', 'config'), 'utf-8')
if !name && FS.existsSync(Path.join path, '.git', 'config')
config = FS.readFileSync(Path.join(path, '.git', 'config'), 'utf-8')
name = /github\.com[:/][^/]+\/(.*)\.git/.exec(config)?[1]

else
if !name
name = Path.basename(path)

return name.charAt(0).toUpperCase() + name.slice(1)
Expand Down

0 comments on commit e14fb21

Please sign in to comment.