Merge remote branch 'Sutto/master'
This commit is contained in:
@@ -25,6 +25,10 @@ With the castle cloned, you can now link its contents into your home dir:
|
|||||||
|
|
||||||
homesick symlink pickled-vim
|
homesick symlink pickled-vim
|
||||||
|
|
||||||
|
If uou use the shorthand syntax for GitHub repositories in your clone, please note you will instead need to run:
|
||||||
|
|
||||||
|
homesick symlink technicalpickles/pickled-vim
|
||||||
|
|
||||||
If you're not sure what castles you have around, you can easily list them:
|
If you're not sure what castles you have around, you can easily list them:
|
||||||
|
|
||||||
homesick list
|
homesick list
|
||||||
|
|||||||
@@ -44,13 +44,20 @@ class Homesick < Thor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "pull NAME", "Update the specified castle"
|
||||||
|
def pull(name)
|
||||||
|
check_castle_existance(name, "pull")
|
||||||
|
|
||||||
|
inside repos_dir.join(name) do
|
||||||
|
git_pull
|
||||||
|
git_submodule_init
|
||||||
|
git_submodule_update
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
desc "symlink NAME", "Symlinks all dotfiles from the specified castle"
|
desc "symlink NAME", "Symlinks all dotfiles from the specified castle"
|
||||||
def symlink(name)
|
def symlink(name)
|
||||||
unless castle_dir(name).exist?
|
check_castle_existance(name, "symlink")
|
||||||
say_status :error, "Could not symlink #{name}, expected #{castle_dir(name)} exist and contain dotfiles", :red
|
|
||||||
|
|
||||||
exit(1)
|
|
||||||
end
|
|
||||||
|
|
||||||
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)}
|
||||||
@@ -106,9 +113,16 @@ class Homesick < Thor
|
|||||||
@repos_dir ||= home_dir.join('.homesick', 'repos').expand_path
|
@repos_dir ||= home_dir.join('.homesick', 'repos').expand_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def castle_dir(name)
|
def castle_dir(name)
|
||||||
repos_dir.join(name, 'home')
|
repos_dir.join(name, 'home')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_castle_existance(name, action)
|
||||||
|
unless castle_dir(name).exist?
|
||||||
|
say_status :error, "Could not #{action} #{name}, expected #{castle_dir(name)} exist and contain dotfiles", :red
|
||||||
|
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ class Homesick
|
|||||||
system "git submodule --quiet update >/dev/null 2>&1" unless options[:pretend]
|
system "git submodule --quiet update >/dev/null 2>&1" unless options[:pretend]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def git_pull(config = {})
|
||||||
|
say_status 'git pull', '', :green unless options[:quiet]
|
||||||
|
system "git pull --quiet" unless options[:pretend]
|
||||||
|
end
|
||||||
|
|
||||||
def ln_s(source, destination, config = {})
|
def ln_s(source, destination, config = {})
|
||||||
source = Pathname.new(source)
|
source = Pathname.new(source)
|
||||||
destination = Pathname.new(destination)
|
destination = Pathname.new(destination)
|
||||||
|
|||||||
Reference in New Issue
Block a user