module Check.Types where
import CoreTypes
import Data.Digest.Pure.MD5 (MD5Digest)
type HashDigest = MD5Digest
data Diagnostics
= Nonexistent
| IsFile
| IsDirectory
| IsLinkTo FilePath
| IsWeird
deriving (Show, Eq)
data DiagnosedFp = D
{ diagnosedFilePath :: FilePath
, diagnosedDiagnostics :: Diagnostics
, diagnosedHashDigest :: HashDigest
} deriving (Show, Eq)
data Instruction = Instruction FilePath FilePath DeploymentKind
deriving (Show, Eq)
data CleanupInstruction
= CleanFile FilePath
| CleanDirectory FilePath
| CleanLink FilePath
deriving (Show, Eq)
data DeploymentCheckResult
= DeploymentDone
| ReadyToDeploy Instruction
| DirtySituation String Instruction CleanupInstruction
| ImpossibleDeployment [String]
deriving (Show, Eq)
data CheckResult
= AlreadyDone
| Ready Instruction
| Dirty String Instruction CleanupInstruction
| Impossible String
deriving (Show, Eq)
data DiagnosedDeployment = Diagnosed
{ diagnosedSrcs :: [DiagnosedFp]
, diagnosedDst :: DiagnosedFp
, diagnosedKind :: DeploymentKind
} deriving (Show, Eq)