Permalink
Browse files

Update node-gyp to 0.5

  • Loading branch information...
1 parent 8689ba8 commit 7fa19049310eed9d766f10fb6e6edd9101676515 @isaacs isaacs committed Jun 15, 2012
View
@@ -28,6 +28,8 @@ function init (args, cb) {
data = {}
}
+ if (data.author) data.author = parseAuthor(data.author)
+
data.author = data.author ||
{ name: npm.config.get("init.author.name")
, email: npm.config.get("init.author.email")
@@ -237,6 +239,18 @@ function cleanupPath (m, folder) {
return m
}
+function parseAuthor (person) {
+ if (typeof person !== "string") return person
+ var name = person.match(/^([^\(<]+)/)
+ var url = person.match(/\(([^\)]+)\)/)
+ var email = person.match(/<([^>]+)>/)
+ var obj = {}
+ if (name && name[0].trim()) obj.name = name[0].trim()
+ if (email) obj.email = email[1];
+ if (url) obj.url = url[1];
+ return obj
+}
+
function unparseAuthor (a) {
if (!a) return ""
if (typeof a === "string") return a

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 7fa1904

Please sign in to comment.