Method: Thor::Actions#link_file

Defined in:
lib/thor/actions/file_manipulation.rb

Links the file from the relative source to the relative destination. If the destination is not given it’s assumed to be equal to the source.

Parameters

source<String>

the relative path to the source root.

destination<String>

the relative path to the destination root.

config<Hash>

give :verbose => false to not log the status.

Examples

link_file "README", "doc/README"

link_file "doc/README"
[View source]

50
51
52
53
54
55
56
# File 'lib/thor/actions/file_manipulation.rb', line 50

def link_file(source, *args)
  config = args.last.is_a?(Hash) ? args.pop : {}
  destination = args.first || source
  source = File.expand_path(find_in_source_paths(source.to_s))

  create_link destination, source, config
end