cd KNOWN_DIR before executing any functions or tools
It is fucking amazing how much shit breaks if CWD is invalid. Fucking amazing. Also fuck you dumb user who can't figure out what "No such file or directory - getcwd" means so you force me to waste half an hour fixing it for you.
This commit is contained in:
parent
63d8cb1a6b
commit
cadc0506f9
@ -66,6 +66,10 @@ def macos_version
|
||||
@macos_version ||= /(10\.\d+)(\.\d+)?/.match(`/usr/bin/sw_vers -productVersion`).captures.first.to_f
|
||||
end
|
||||
|
||||
# The block form of Dir.chdir fails later if Dir.CWD doesn't exist which I
|
||||
# guess is fair enough. Also sudo prints a warning message for no good reason
|
||||
Dir.chdir "/usr"
|
||||
|
||||
####################################################################### script
|
||||
abort "MacOS too old, see: https://gist.github.com/1144389" if macos_version < 10.5
|
||||
abort "/usr/local/.git already exists!" unless Dir["/usr/local/.git/*"].empty?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user