From 0169214b3f24a24b231f044056fdcf1ff0103154 Mon Sep 17 00:00:00 2001 From: NAmorim Date: Mon, 11 Oct 2021 12:00:41 +0100 Subject: [PATCH] Disable git check when running as packaged app --- Platform/Client/httpInterface.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Platform/Client/httpInterface.js b/Platform/Client/httpInterface.js index dd933ba67..79832c2f3 100644 --- a/Platform/Client/httpInterface.js +++ b/Platform/Client/httpInterface.js @@ -631,7 +631,13 @@ exports.newHttpInterface = function newHttpInterface() { break case 'App': { + // If running the electron app do not try to get git tool. I don't allow it. + if (process.env.SA_MODE === 'gitDisable') { + console.log('[WARNING] No contributions on binary distributions. Do manual installation') + break + } switch (requestPath[2]) { // switch by command + case 'Contribute': { try { let commitMessage = unescape(requestPath[3]) @@ -641,7 +647,7 @@ exports.newHttpInterface = function newHttpInterface() { const contributionsBranch = unescape(requestPath[7]) let error - /* Unsavping # */ + /* Unsaving # */ for (let i = 0; i < 10; i++) { commitMessage = commitMessage.replace('_SLASH_', '/') commitMessage = commitMessage.replace('_HASHTAG_', '#') @@ -649,11 +655,11 @@ exports.newHttpInterface = function newHttpInterface() { contribute() - async function contribute() { + async function contribute() { const { lookpath } = SA.nodeModules.lookpath const gitpath = await lookpath('git') if (gitpath === undefined) { - console.log('[ERROR] `git` not installed.') + console.log('[ERROR] `git` not installed. Line 656') } else { await doGit() if (error !== undefined) {