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