Skip to content

Commit

Permalink
up: use $PWD by default
Browse files Browse the repository at this point in the history
`Pathname.pwd` calls the `getcwd()` syscall which returns the resolved
current directory. Bash exports $PWD which contains the current
unresolved directory, so use that instead.

Should fix #3
  • Loading branch information
zimbatm committed Jan 23, 2020
1 parent ea75147 commit 1df1c24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion up
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ up() {
end

HOME = Pathname.new(ENV['HOME']) if ENV['HOME']
PWD = Pathname.pwd
PWD = ENV['PWD'] ? Pathname.new(ENV['PWD']) : Pathname.pwd

def project_root?(dir)
(dir + '.git').directory? ||
Expand Down

0 comments on commit 1df1c24

Please sign in to comment.