Module CPM.Package.Helpers

This module contains some operations for processing packages, like installing package sources, cleaning packages, rendering package infos.

Summary of exported operations:

installPackageSourceTo :: Package -> PackageSource -> String -> ErrorLogger ()  Deterministic 
Installs the source of the package from the given source location into the subdirectory packageId pkg of the given directory.
cleanPackage :: Config -> LogLevel -> ErrorLogger ()  Deterministic 
Cleans auxiliary files in the local package, i.e., the package containing the current working directory.
renderPackageInfo :: Bool -> Bool -> Bool -> Package -> String  Deterministic 
Renders information about a package.
getLocalPackageSpec :: Config -> String -> ErrorLogger String  Deterministic 
Tries to find a package specification in the given directory or one of its ancestors.

Exported operations:

installPackageSourceTo :: Package -> PackageSource -> String -> ErrorLogger ()  Deterministic 

Installs the source of the package from the given source location into the subdirectory packageId pkg of the given directory.

cleanPackage :: Config -> LogLevel -> ErrorLogger ()  Deterministic 

Cleans auxiliary files in the local package, i.e., the package containing the current working directory.

renderPackageInfo :: Bool -> Bool -> Bool -> Package -> String  Deterministic 

Renders information about a package.

getLocalPackageSpec :: Config -> String -> ErrorLogger String  Deterministic 

Tries to find a package specification in the given directory or one of its ancestors. If there is no package specifiction in these directories, the home package specification (i.e., ~/.cpm/home-package/package.json is returned (and created if it does not exist). In order to avoid infinite loops due to cyclic file structures, the search is limited to the number of directories occurring in the current absolute path.