move castle/home/.homesick_subdir to castle/.homesick_subdir
This commit is contained in:
@@ -263,7 +263,7 @@ class Homesick < Thor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def subdir_file(castle)
|
def subdir_file(castle)
|
||||||
castle_dir(castle).join(SUBDIR_FILENAME)
|
repos_dir.join(castle, SUBDIR_FILENAME)
|
||||||
end
|
end
|
||||||
|
|
||||||
def subdirs(castle)
|
def subdirs(castle)
|
||||||
@@ -331,9 +331,6 @@ class Homesick < Thor
|
|||||||
absolute_path = path.expand_path
|
absolute_path = path.expand_path
|
||||||
castle_home = castle_dir(castle)
|
castle_home = castle_dir(castle)
|
||||||
|
|
||||||
# ignore subdir file
|
|
||||||
next if absolute_path == castle_home.join(SUBDIR_FILENAME)
|
|
||||||
|
|
||||||
# make ignore dirs
|
# make ignore dirs
|
||||||
ignore_dirs = []
|
ignore_dirs = []
|
||||||
subdirs.each do |subdir|
|
subdirs.each do |subdir|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ describe "homesick" do
|
|||||||
some_nested_file = home.file('some/nested/file.txt')
|
some_nested_file = home.file('some/nested/file.txt')
|
||||||
homesick.track(some_nested_file.to_s, 'castle_repo')
|
homesick.track(some_nested_file.to_s, 'castle_repo')
|
||||||
|
|
||||||
subdir_file = castle.join(Homesick::SUBDIR_FILENAME)
|
subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME)
|
||||||
File.open(subdir_file, 'r') do |f|
|
File.open(subdir_file, 'r') do |f|
|
||||||
f.readline.should == "some/nested\n"
|
f.readline.should == "some/nested\n"
|
||||||
end
|
end
|
||||||
@@ -262,7 +262,7 @@ describe "homesick" do
|
|||||||
homesick.track(some_nested_file.to_s, 'castle_repo')
|
homesick.track(some_nested_file.to_s, 'castle_repo')
|
||||||
homesick.track(other_nested_file.to_s, 'castle_repo')
|
homesick.track(other_nested_file.to_s, 'castle_repo')
|
||||||
|
|
||||||
subdir_file = castle.join(Homesick::SUBDIR_FILENAME)
|
subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME)
|
||||||
File.open(subdir_file, 'r') do |f|
|
File.open(subdir_file, 'r') do |f|
|
||||||
f.readlines.size.should == 1
|
f.readlines.size.should == 1
|
||||||
end
|
end
|
||||||
@@ -276,7 +276,7 @@ describe "homesick" do
|
|||||||
homesick.track(some_nested_file.to_s, 'castle_repo')
|
homesick.track(some_nested_file.to_s, 'castle_repo')
|
||||||
homesick.track(nested_parent.to_s, 'castle_repo')
|
homesick.track(nested_parent.to_s, 'castle_repo')
|
||||||
|
|
||||||
subdir_file = castle.join(Homesick::SUBDIR_FILENAME)
|
subdir_file = castle.parent.join(Homesick::SUBDIR_FILENAME)
|
||||||
File.open(subdir_file, 'r') do |f|
|
File.open(subdir_file, 'r') do |f|
|
||||||
f.each_line { |line| line.should_not == "some/nested\n" }
|
f.each_line { |line| line.should_not == "some/nested\n" }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,14 +22,13 @@ RSpec.configure do |config|
|
|||||||
Dir.chdir(castle) do
|
Dir.chdir(castle) do
|
||||||
system "git init >/dev/null 2>&1"
|
system "git init >/dev/null 2>&1"
|
||||||
system "git remote add origin git://github.com/technicalpickles/#{name}.git >/dev/null 2>&1"
|
system "git remote add origin git://github.com/technicalpickles/#{name}.git >/dev/null 2>&1"
|
||||||
castle_home = castle.directory("home")
|
|
||||||
if subdirs then
|
if subdirs then
|
||||||
subdir_file = castle_home.join(Homesick::SUBDIR_FILENAME)
|
subdir_file = castle.join(Homesick::SUBDIR_FILENAME)
|
||||||
subdirs.each do |subdir|
|
subdirs.each do |subdir|
|
||||||
system "echo #{subdir} >> #{subdir_file}"
|
system "echo #{subdir} >> #{subdir_file}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return castle_home
|
return castle.directory("home")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user