mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew ln works with relative paths
This commit is contained in:
parent
bab81f6d00
commit
86df92e94f
@ -17,12 +17,12 @@ case ARGV[0]
|
|||||||
#TODO check is under +/ with name AND version
|
#TODO check is under +/ with name AND version
|
||||||
#TODO you should mkdirs as you find them and symlink files otherwise
|
#TODO you should mkdirs as you find them and symlink files otherwise
|
||||||
#TODO consider using hardlinks
|
#TODO consider using hardlinks
|
||||||
|
|
||||||
Find.find ARGV[1] do |from|
|
target=Pathname.new(ARGV[1]).realpath
|
||||||
|
target.find do |from|
|
||||||
next if from == ARGV[1] #rubysucks
|
next if from == ARGV[1] #rubysucks
|
||||||
|
|
||||||
from=Pathname.new from
|
to=$root+from.relative_path_from(target)
|
||||||
to=$root+from.relative_path_from(Pathname.new(ARGV[1]))
|
|
||||||
|
|
||||||
if from.directory?
|
if from.directory?
|
||||||
to.mkpath unless to.exist?
|
to.mkpath unless to.exist?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user