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) {