diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-16 15:36:24 -0400 |
| commit | 06f4258f8174302a825a893b3407df9cff15c577 (patch) | |
| tree | 9673a75b78716852425e417a1d8519de2d8b20ca /src/Propellor/Property/File.hs | |
| parent | f3a4b1a1beab90e2c630465811ce4a198ad7ba0f (diff) | |
| parent | 7f7249f801653e0bd7fa083ed001bf3c5a3c3900 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/File.hs')
| -rw-r--r-- | src/Propellor/Property/File.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Propellor/Property/File.hs b/src/Propellor/Property/File.hs index 12a3e80a..08fdc780 100644 --- a/src/Propellor/Property/File.hs +++ b/src/Propellor/Property/File.hs @@ -97,10 +97,14 @@ dirExists :: FilePath -> Property NoInfo dirExists d = check (not <$> doesDirectoryExist d) $ property (d ++ " exists") $ makeChange $ createDirectoryIfMissing True d --- | Creates or atomically updates a symbolic link. Does not overwrite regular --- files or directories. -isSymlinkedTo :: FilePath -> FilePath -> Property NoInfo -link `isSymlinkedTo` target = property desc $ +-- | The location that a symbolic link points to. +newtype LinkTarget = LinkTarget FilePath + +-- | Creates or atomically updates a symbolic link. +-- +-- Does not overwrite regular files or directories. +isSymlinkedTo :: FilePath -> LinkTarget -> Property NoInfo +link `isSymlinkedTo` (LinkTarget target) = property desc $ go =<< (liftIO $ tryIO $ getSymbolicLinkStatus link) where desc = link ++ " is symlinked to " ++ target |
