bin/powder in powder-0.3.0.pre3 vs bin/powder in powder-0.3.0.pre4
- old
+ new
@@ -227,12 +227,17 @@
desc "remove", "An alias to Unlink (deprecated)"
alias :remove :unlink
desc "cleanup", "Clean up invalid symbolic link"
def cleanup
- Dir[POW_PATH + "/*"].map { |symlink|
- FileUtils.rm(symlink) unless File.exists? File.readlink(symlink)
- }
+ Dir[POW_PATH + "/*"].map do |symlink|
+ begin
+ FileUtils.rm(symlink) unless File.exists?(File.readlink(symlink))
+ rescue
+ # Not all platforms support File.readlink, thus throwing exceptions.
+ # Unfortunately we can't decide then if a symlink is invalid.
+ end
+ end
end
desc "install", "Installs or updates pow"
def install
%x{curl get.pow.cx | sh}