Add a better error message when a repo's home doesn't exist.

This commit is contained in:
Joshua Nichols
2010-04-02 00:53:17 -04:00
parent 02c3fda939
commit a798f3c562

View File

@@ -45,14 +45,14 @@ class Homesick < Thor
end
desc "symlink NAME", "Symlinks all dotfiles from the specified castle"
def symlink(home)
unless castle_dir(home).exist?
say_status :error, "Castle #{home} did not exist in #{repos_dir}", :red
def symlink(name)
unless castle_dir(name).exist?
say_status :error, "Could not symlink #{name}, expected #{castle_dir(name)} exist and contain dotfiles", :red
exit(1)
end
else
inside castle_dir(home) do
inside castle_dir(name) do
files = Pathname.glob('.*').reject{|a| [".",".."].include?(a.to_s)}
files.each do |path|
absolute_path = path.expand_path
@@ -66,8 +66,6 @@ class Homesick < Thor
end
end
end
desc "list", "List cloned castles"
def list
Pathname.glob(repos_dir + "*") do |castle|