From aa85c4f87a27b205a64cb7eb22efe575a9bf1cc0 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Fri, 16 Aug 2024 16:00:44 +0530 Subject: [PATCH] Fix docker build failing --- scripts/build-plugins/service-worker.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/build-plugins/service-worker.js b/scripts/build-plugins/service-worker.js index 9939440d..1916ddb2 100644 --- a/scripts/build-plugins/service-worker.js +++ b/scripts/build-plugins/service-worker.js @@ -205,10 +205,14 @@ function definePlaceholderValue(mode, name, devValue) { * @see https://stackoverflow.com/a/35778030 */ function getLatestGitCommitHash() { - return require("child_process") - .execSync("git rev-parse --short HEAD") - .toString() - .trim(); + try { + return require("child_process") + .execSync("git rev-parse --short HEAD") + .toString() + .trim(); + } catch { + return "could_not_fetch_sha"; + } } function createPlaceholderValues(mode) {