Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
Add fs.realpathSync to resolve folder real path
Browse files Browse the repository at this point in the history
Closes #49
  • Loading branch information
tlex authored and nouser committed Apr 8, 2018
1 parent f0d7969 commit 2e72fab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
fs = require 'fs'
path = require 'path'

normalizePath = (repoPath) ->
Expand All @@ -9,9 +10,9 @@ normalizePath = (repoPath) ->
# For now just strip away the /private part.
# Using the fs.realPath function to avoid this issue isn't such a good
# idea because it tries to access that path and in case it's not
# existing path an error gets thrown + it's slow due to fs access.
# existing path an error gets thrown
normPath = normPath.replace(/^\/private/, '')
return normPath.replace(/[\\\/]$/, '')
return fs.realpathSync(normPath.replace(/[\\\/]$/, ''))

getRootDirectoryStatus = (repo) ->
promise = Promise.resolve()
Expand Down

0 comments on commit 2e72fab

Please sign in to comment.