Skip to content

Commit

Permalink
fix: lazy git interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 4, 2023
1 parent 7f97014 commit 04975fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const RECIPES_BY_FEATURES_KEYS = Object.keys(
const getLastModifiedDate = filepath =>
exec.stdout(`git log --max-count=1 --format="%cI" -- ${filepath}`)

const branchName = exec.stdout('git rev-parse --abbrev-ref HEAD')
const branchName = () => exec.stdout('git rev-parse --abbrev-ref HEAD')

const githubUrl = (() => {
return async filepath => {
const base = `https://github.com/microlinkhq/www/blob/${await branchName}`
const base = `https://github.com/microlinkhq/www/blob/${await branchName()}`
const relative = filepath.replace(process.cwd(), '')
return base + relative
}
Expand Down

1 comment on commit 04975fe

@vercel
Copy link

@vercel vercel bot commented on 04975fe Sep 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.