Skip to content

Commit

Permalink
fix(fleekci): git not mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Mar 15, 2024
1 parent dd91756 commit fb70003
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`
}
}

/**
Expand Down

0 comments on commit fb70003

Please sign in to comment.