-- Generated by scripts/generate.mjs. Do not edit. module Dagger.CurrentModule ( contextDirectory , dependencies , generatedContextDirectory , id , name , source , sourceSubpath , workdir , workdirWith , WorkdirOpts , defaultWorkdirOpts , workdirFile ) where import Data.Maybe (Maybe(..)) import Effect.Aff (Aff) import Dagger.Internal.Runtime as R import Dagger.Types as T -- | The module's context directory loaded into the engine (plus any generated code that may have been created). -- | -- | It holds the module's source code and every other file the engine loaded for the module, at their paths relative to the context root. Use sourceSubpath to locate the source code in it. contextDirectory :: T.CurrentModule -> T.Directory contextDirectory = R.select "contextDirectory" [] -- | The dependencies of the module. dependencies :: T.CurrentModule -> Aff (Array T.Module) dependencies = R.objectList "Module" "dependencies" [] -- | The generated files and directories made on top of the module source's context directory. generatedContextDirectory :: T.CurrentModule -> T.Directory generatedContextDirectory = R.select "generatedContextDirectory" [] -- | A unique identifier for this CurrentModule. id :: T.CurrentModule -> Aff T.ID id = R.scalar "id" [] -- | The name of the module being executed in name :: T.CurrentModule -> Aff String name = R.scalar "name" [] -- | The directory containing the module's source code loaded into the engine (plus any generated code that may have been created). source :: T.CurrentModule -> T.Directory source = R.select "source" [] -- | The path to the directory containing the module's source code, relative to the context directory. sourceSubpath :: T.CurrentModule -> Aff String sourceSubpath = R.scalar "sourceSubpath" [] type WorkdirOpts = { exclude :: Maybe (Array String) , include :: Maybe (Array String) , gitignore :: Maybe Boolean } defaultWorkdirOpts :: WorkdirOpts defaultWorkdirOpts = { exclude: Nothing , include: Nothing , gitignore: Nothing } -- | Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution. workdir :: String -> T.CurrentModule -> T.Directory workdir argPath = workdirWith argPath defaultWorkdirOpts -- | Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution. workdirWith :: String -> WorkdirOpts -> T.CurrentModule -> T.Directory workdirWith argPath opts = R.select "workdir" [R.argument "path" "String!" argPath, R.optional (R.argument "exclude" "[String!]") opts.exclude, R.optional (R.argument "include" "[String!]") opts.include, R.optional (R.argument "gitignore" "Boolean") opts.gitignore] -- | Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution. workdirFile :: String -> T.CurrentModule -> T.File workdirFile argPath = R.select "workdirFile" [R.argument "path" "String!" argPath]