From a7c4f42ef073e8ba303dd8b8c001a9f71399828d Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 30 Apr 2017 00:49:26 -0400 Subject: [PATCH] fix: Incorrect git remote rm error --- package.json | 1 + server/configure.js | 4 ++-- server/views/pages/view.pug | 3 +++ yarn.lock | 37 ++++++++++++++++++++++++++++++------- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 34c0662b..6a37f746 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "connect-mongo": "^1.3.2", "cookie-parser": "^1.4.3", "cron": "^1.2.1", + "diff2html": "^2.3.0", "execa": "^0.6.3", "express": "^4.15.2", "express-brute": "^1.0.1", diff --git a/server/configure.js b/server/configure.js index d1b1c1ea..cec9ac1b 100644 --- a/server/configure.js +++ b/server/configure.js @@ -221,8 +221,8 @@ module.exports = (port, spinner) => { }, () => { if (req.body.gitUseRemote === false) { return false } - return exec.stdout('git', ['remote', 'remove', 'origin'], { cwd: gitDir }).catch(err => { - if (_.includes(err.message, 'No such remote')) { + return exec.stdout('git', ['remote', 'rm', 'origin'], { cwd: gitDir }).catch(err => { + if (_.includes(err.message, 'No such remote') || _.includes(err.message, 'Could not remove')) { return true } else { throw err diff --git a/server/views/pages/view.pug b/server/views/pages/view.pug index 999428f6..bcf55d62 100644 --- a/server/views/pages/view.pug +++ b/server/views/pages/view.pug @@ -18,6 +18,9 @@ block rootNavRight a.button.is-outlined(href='/source/' + pageData.meta.path) i.icon-loader span Source + a.button.is-outlined(href='/diff/' + pageData.meta.path) + i.icon-flow-merge + span Diff if rights.write a.button(href='/edit/' + pageData.meta.path) i.icon-document-text diff --git a/yarn.lock b/yarn.lock index 040cfa03..96e8a8ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1800,7 +1800,15 @@ dicer@0.2.5: readable-stream "1.1.x" streamsearch "0.1.2" -diff@^3.0.0: +diff2html@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/diff2html/-/diff2html-2.3.0.tgz#375fb0783ca8fa90307749399bc9c75eb7cf6580" + dependencies: + diff "^3.2.0" + hogan.js "^3.0.2" + whatwg-fetch "^2.0.3" + +diff@^3.0.0, diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -2965,6 +2973,13 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hogan.js@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd" + dependencies: + mkdirp "0.3.0" + nopt "1.0.10" + home-or-tmp@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-1.0.0.tgz#4b9f1e40800c3e50c6c27f781676afcce71f3985" @@ -4479,6 +4494,10 @@ minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" +mkdirp@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" + mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" @@ -4734,6 +4753,12 @@ noop-logger@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" +nopt@1.0.10, nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + dependencies: + abbrev "1" + "nopt@2 || 3": version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -4747,12 +4772,6 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -nopt@~1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - dependencies: - abbrev "1" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" @@ -7067,6 +7086,10 @@ whatwg-encoding@^1.0.1: dependencies: iconv-lite "0.4.13" +whatwg-fetch@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" + whatwg-url@^4.3.0: version "4.7.1" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de"