-- | List the packages inside the current project.
listPackages :: HasEnvConfig env => RIO env ()
listPackages = do
    -- TODO: Instead of setting up an entire EnvConfig only to look up the package directories,
    -- make do with a Config (and the Project inside) and use resolvePackageEntry to get
    -- the directory.
    packageDirs <- liftM (map lpvRoot . Map.elems . lpProject) getLocalPackages
    forM_ packageDirs $ \dir -> do
        cabalfp <- findOrGenerateCabalFile dir
        pkgName <- parsePackageNameFromFilePath cabalfp
        (logInfo . packageNameText) pkgName

-- | List the targets in the current project.
listPackages :: HasEnvConfig env => RIO env ()
listPackages = do
    -- TODO: Instead of setting up an entire EnvConfig only to look up the package directories,
    -- make do with a Config (and the Project inside) and use resolvePackageEntry to get
    -- the directory.
    packageDirs <- liftM (map lpvRoot . Map.elems . lpProject) getLocalPackages
    forM_ packageDirs $ \dir -> do
        cabalfp <- findOrGenerateCabalFile dir
        pkgName <- parsePackageNameFromFilePath cabalfp
        (logInfo . packageNameText) pkgName

-- | List the targets in the current project.
listPackages = do
    -- TODO: Instead of setting up an entire EnvConfig only to look up the package directories,
    -- make do with a Config (and the Project inside) and use resolvePackageEntry to get
    -- the directory.
    packageDirs <- liftM (map lpvRoot . Map.elems . lpProject) getLocalPackages
    forM_ packageDirs $ \dir -> do
        cabalfp <- findOrGenerateCabalFile dir
        pkgName <- parsePackageNameFromFilePath cabalfp
        (logInfo . packageNameText) pkgName

-- | List the targets in the current project.