Something went wrong. Try again.
A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738-- Generated by Gleam CI helpers.module CI.ModuleDependencies (ensureFor) where
import Preludeimport Data.Either (Either(..))import Effect (Effect)import Effect.Exception (throw, try)import FluentCI.Plugin as P
foreign import installDependency :: String -> Effect Unit
probe :: Array String -> Effect Unitprobe args = do result <- P.pipeline "setup-dependency-preflight" # P.exec args # P.stdout case result of Left error -> throw (P.errorMessage error) Right _ -> pure unit
ensure :: String -> Array String -> Effect Unitensure alias args = do present <- try (probe args) case present of Right _ -> pure unit Left _ -> do installDependency alias probe args
ensureFor :: String -> Effect UnitensureFor executable = do os <- P.getOS >>= case _ of Left error -> throw (P.errorMessage error) Right value -> pure value unless (os == "linux" || os == "macos" || os == "freebsd" || os == "openbsd" || os == "netbsd") $ throw ("Unsupported setup dependency OS: " <> os) ensure "setup-cypress" [ "which", "cypress" ] when (executable == "bun") $ ensure "setup-bun" [ "which", "bun" ]