lib/itamae/resource/link.rb in itamae-1.0.0.beta32 vs lib/itamae/resource/link.rb in itamae-1.0.0.beta33
- old
+ new
@@ -13,13 +13,13 @@
@attributes[:exist?] = true
end
end
def set_current_attributes
- @current_attributes[:exist?] = (run_command(["test", "-L", link], error: false).exit_status == 0)
+ @current_attributes[:exist?] = run_specinfra(:check_file_is_link, link)
if @current_attributes[:exist?]
- @current_attributes[:to] = run_command(["readlink", "-f", link]).stdout.strip
+ @current_attributes[:to] = run_specinfra(:get_file_link_target, link).stdout.strip
end
end
def create_action(options)
unless run_specinfra(:check_file_is_linked_to, link, to)