From bb74c71896f20ab3d2cb0900a105a7d2b11d28f7 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sat, 26 Nov 2016 12:38:17 +0100 Subject: [PATCH] Check if path is a repo path via regex --- lib/github.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/github.js b/lib/github.js index c8db1fb..3135db4 100644 --- a/lib/github.js +++ b/lib/github.js @@ -56,13 +56,7 @@ export const isRepoPath = path => { return false } - const slashCount = path.split('/').length - 1 - - if (!slashCount || slashCount > 1) { - return false - } - - return true + return /[^\s\\]\/[^\s\\]/g.test(path) } export const onGitHub = async (path, debug) => {