Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included files can be a list #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GitLab/Include/Type.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let Rule = ../Rule/Type.dhall

let Include =
{ local : Optional Text
, file : Optional Text
, file : List Text
, remote : Optional Text
, template : Optional Text
, rules : List Rule
Expand Down
2 changes: 1 addition & 1 deletion GitLab/Include/default.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let Rule = ../Rule/Type.dhall
let Include = ./Type.dhall

in { local = None Text
, file = None Text
, file = [] : List Text
, remote = None Text
, template = None Text
, rules = [] : List Rule
Expand Down
6 changes: 5 additions & 1 deletion GitLab/Include/toJSON.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ let Rule = ../Rule/package.dhall

let dropNones = ../utils/dropNones.dhall

let stringsArrayJSON = ../utils/stringsArrayJSON.dhall

let Include/toJSON
: Include → JSON.Type
= λ(include : Include) →
Expand All @@ -23,7 +25,9 @@ let Include/toJSON
JSON.string
include.local
, file =
Prelude.Optional.map Text JSON.Type JSON.string include.file
if Prelude.List.null Text include.file
then None JSON.Type
else Some (stringsArrayJSON include.file)
, remote =
Prelude.Optional.map
Text
Expand Down
5 changes: 3 additions & 2 deletions Prelude.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
This file also provides an import without the integrity check as a slower
fallback if the user is using a different version of the Dhall interpreter.
-}

env:DHALL_PRELUDE
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
3 changes: 2 additions & 1 deletion examples/single-job.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
let GitLab =
https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/package.dhall
../package.dhall
? https://raw.githubusercontent.com/bgamari/dhall-gitlab-ci/master/package.dhall

let Prelude = GitLab.Prelude

Expand Down