From fb700030ab9116d7a179a79a39bf5575906f7ee5 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Fri, 15 Mar 2024 23:34:08 +0100 Subject: [PATCH] fix(fleekci): git not mandatory --- webpack.config.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 991a4cc5..48159910 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -161,9 +161,13 @@ const dev = { * @returns {string} A string representing the Git branch and short SHA. */ const gitRevision = () => { - const ref = execSync('git rev-parse --abbrev-ref HEAD').toString().trim() - const sha = execSync('git rev-parse --short HEAD').toString().trim() - return `${ref}@${sha}` + try { + const ref = execSync('git rev-parse --abbrev-ref HEAD').toString().trim() + const sha = execSync('git rev-parse --short HEAD').toString().trim() + return `${ref}@${sha}` + } catch (_) { + return `no-git-dirty@${new Date().getTime().toString()}` + } } /**