lib/overcommit/utils/file_utils.rb
# When the host OS is Windows, uses the `dir` command to check whether
# `link_name` is an NTFS symbolic link. If so, it parses the target from
# the command output. Otherwise raises an `ArgumentError`. Delegates to
# `File.readlink` if the host OS is not Windows.
When the host OS is Windows, uses the `dir` command to check whether
`link_name` is an NTFS symbolic link. If so, it parses the target from
the command output. Otherwise raises an `ArgumentError`. Delegates to
`File.readlink` if the host OS is not Windows.
When the host OS is Windows uses the ` dir ` command to check whether ` link_name ` is an NTFS symbolic link . If so it parses the target from the command output . Otherwise raises an ` ArgumentError ` . Delegates to ` File . readlink ` if the host OS is not Windows .
def readlink(link_name)
        return File.readlink(link_name) unless Overcommit::OS.windows?
        result = win32_dir_cmd(link_name)
        unless win32_symlink?(result.stdout)
          raise ArgumentError, "#{link_name} is not a symlink"
        end
        result.stdout[/\[(.+)\]/, 1]
      end
def readlink ( link_name ) return File . readlink ( link_name ) unless Overcommit :: OS . windows? result = win32_dir_cmd ( link_name ) unless win32_symlink? ( result . stdout ) raise ArgumentError , "#{link_name} is not a symlink" end result . stdout [ / \[ (.+) \] / , 1 ] end
When the host OS is Windows, uses the `dir` command to check whether
`link_name` is an NTFS symbolic link.
When the host OS is Windows uses the ` dir ` command to check whether ` link_name ` is an NTFS symbolic link .
# Extract symlink target from output, which looks like: #   11/13/2012 12:53 AM <SYMLINK> mysymlink [C:\Windows\Temp\somefile.txt]
link_name
<not_specific>