Added support for linking non-dotfiles.
This commit is contained in:
@@ -83,7 +83,7 @@ class Homesick < Thor
|
|||||||
check_castle_existance(name, "symlink")
|
check_castle_existance(name, "symlink")
|
||||||
|
|
||||||
inside castle_dir(name) do
|
inside castle_dir(name) 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
|
||||||
|
|
||||||
|
|||||||
@@ -81,16 +81,24 @@ describe "homesick" do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "symlink" do
|
describe "symlink" do
|
||||||
context "for dotfiles" do
|
let(:castle) { given_castle("glencairn") }
|
||||||
it "links dotfiles from a castle to the home folder" do
|
|
||||||
castle = given_castle("glencairn")
|
|
||||||
dotfile = castle.file(".some_dotfile")
|
|
||||||
|
|
||||||
homesick.symlink("glencairn")
|
it "links dotfiles from a castle to the home folder" do
|
||||||
|
dotfile = castle.file(".some_dotfile")
|
||||||
|
|
||||||
@user_dir.join(".some_dotfile").readlink.should == dotfile
|
homesick.symlink("glencairn")
|
||||||
end
|
|
||||||
|
@user_dir.join(".some_dotfile").readlink.should == dotfile
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "links non-dotfiles from a castle to the home folder" do
|
||||||
|
dotfile = castle.file("bin")
|
||||||
|
|
||||||
|
homesick.symlink("glencairn")
|
||||||
|
|
||||||
|
@user_dir.join("bin").readlink.should == dotfile
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "list" do
|
describe "list" do
|
||||||
|
|||||||
Reference in New Issue
Block a user