Skip to content

Commit

Permalink
Fix missing __dirname in the browser
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi committed May 15, 2024
1 parent cc65ad0 commit dee2253
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gitCms/GitCmsConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function findNearestGitRepo(startPath: string): string | null {
return null
}

const repoPath = findNearestGitRepo(__dirname)
const repoPath =
typeof __dirname !== "undefined" ? findNearestGitRepo(__dirname) : null

// todo: refactor GitCmsServer to be a class, and pass this in as a top level param
export const GIT_CMS_DIR = repoPath ? repoPath + "/../owid-content" : ""
Expand Down

0 comments on commit dee2253

Please sign in to comment.