diff options
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 07ace24b..08fdc780 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -97,14 +97,14 @@ dirExists :: FilePath -> Property NoInfo dirExists d = check (not <$> doesDirectoryExist d) $ property (d ++ " exists") $ makeChange $ createDirectoryIfMissing True d +-- | The location that a symbolic link points to. +newtype LinkTarget = LinkTarget FilePath + -- | Creates or atomically updates a symbolic link. -- --- The first parameter is what the link should point to. --- --- The second parameter is the name of the symbolic link to create. -- Does not overwrite regular files or directories. -isSymlinkedTo :: FilePath -> FilePath -> Property NoInfo -link `isSymlinkedTo` target = property desc $ +isSymlinkedTo :: FilePath -> LinkTarget -> Property NoInfo +link `isSymlinkedTo` (LinkTarget target) = property desc $ go =<< (liftIO $ tryIO $ getSymbolicLinkStatus link) where desc = link ++ " is symlinked to " ++ target |
