+14
-6
@@ -26,4 +26,8 @@ (function() { | ||
| return fs.readFile(filePath, __bind(function(err, data) { | ||
| var host, matched, repo, user, _ref; | ||
| _ref = data.toString().match(/.*\[remote\s[\"\']origin[\"\']\][^\[]*.*url\s?=\s?.*@(.*):(.*)\/(.*)\.git\n/), matched = _ref[0], host = _ref[1], user = _ref[2], repo = _ref[3]; | ||
| var host, matched, matches, repo, user; | ||
| matches = data.toString().match(/.*\[remote\s[\"\']origin[\"\']\][^\[]*.*url\s?=\s?.*@(.*):(.*)\/(.*)\.git\n/); | ||
| if (!matches) { | ||
| return; | ||
| } | ||
| matched = matches[0], host = matches[1], user = matches[2], repo = matches[3]; | ||
| if ((host != null) && (user != null) && (repo != null)) { | ||
@@ -35,8 +39,12 @@ return this.open(this.hostURL(host, user, repo)); | ||
| "package.json": function(filePath) { | ||
| var ext, host, match, package, repo, repoName, url, user, _ref, _ref2; | ||
| var ext, host, match, matches, package, repo, repoName, url, user, _ref, _ref2; | ||
| package = require(filePath); | ||
| repo = package.repository; | ||
| url = typeof repo === 'string' ? repo : (_ref = repo.url) != null ? _ref : ""; | ||
| repo = (_ref = package.repository) != null ? _ref : {}; | ||
| url = typeof repo === 'string' ? repo : (_ref2 = repo.url) != null ? _ref2 : ""; | ||
| if (url.length > 0) { | ||
| _ref2 = url.match(/.*:\/\/(.*)\/(.*)\/([^\.]+)(.*)?/), match = _ref2[0], host = _ref2[1], user = _ref2[2], repoName = _ref2[3], ext = _ref2[4]; | ||
| matches = url.match(/.*:\/\/(.*)\/(.*)\/([^\.]+)(.*)?/); | ||
| if (!matches) { | ||
| return; | ||
| } | ||
| match = matches[0], host = matches[1], user = matches[2], repoName = matches[3], ext = matches[4]; | ||
| url = this.hostURL(host, user, repoName); | ||
@@ -43,0 +51,0 @@ } else if (package.name.toString().length > 0) { |
+2
-2
| { | ||
| "name": "gitit", | ||
| "description": "Introspect project directory and launch browser to github repo page", | ||
| "description": "Introspect project directories and launch browser to github repo page", | ||
| "author": "Chris McCord", | ||
| "version": "0.0.3", | ||
| "version": "0.0.4", | ||
| "licenses": [{ | ||
@@ -7,0 +7,0 @@ "type": "MIT", |
+8
-4
@@ -25,7 +25,9 @@ fs = require 'fs' | ||
| fs.readFile filePath, (err, data) => | ||
| [matched, host, user, repo] = data.toString().match ///.* | ||
| matches = data.toString().match ///.* | ||
| \[remote\s[\"\']origin[\"\']\] # origin declaration | ||
| [^\[]* # match anything until next config declaration | ||
| .*url\s?=\s?.*@(.*):(.*)/(.*)\.git\n # extract remote url details | ||
| /// | ||
| /// | ||
| return unless matches | ||
| [matched, host, user, repo] = matches | ||
| @open(@hostURL(host, user, repo)) if host? and user? and repo? | ||
@@ -36,6 +38,8 @@ | ||
| package = require(filePath) | ||
| repo = package.repository | ||
| repo = package.repository ? {} | ||
| url = if typeof(repo) is 'string' then repo else repo.url ? "" | ||
| if url.length > 0 | ||
| [match, host, user, repoName, ext] = url.match(/.*:\/\/(.*)\/(.*)\/([^\.]+)(.*)?/) | ||
| matches = url.match(/.*:\/\/(.*)\/(.*)\/([^\.]+)(.*)?/) | ||
| return unless matches | ||
| [match, host, user, repoName, ext] = matches | ||
| url = @hostURL(host, user, repoName) | ||
@@ -42,0 +46,0 @@ else if package.name.toString().length > 0 |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
7715
4.38%79
11.27%