Skip to content

Commit 35fa9f6

Browse files
authored
Also download dhall-yaml (#3)
* also download dhall-yaml * address nit
1 parent 6283fa7 commit 35fa9f6

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
run: |
2828
echo "dhall version: $(dhall version)"
2929
echo "dhall-json version: $(dhall-to-json --version)"
30+
echo "dhall-yaml version: $(dhall-to-yaml --version)"

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This will add the following executables to your `PATH`, making them available fo
1010
- `dhall-to-json`
1111
- `dhall-to-yaml`
1212
- `json-to-dhall`
13+
- `yaml-to-dhall`
1314

1415
## Inputs
1516

src/action.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const releasePatterns = () => {
2323
return {
2424
core: new RegExp(`dhall-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'),
2525
json: new RegExp(`dhall-json-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'),
26+
yaml: new RegExp(`dhall-yaml-[0-9.]+.*-${platformSuffix}\.tar\.bz2`, 'i'),
2627
}
2728
}
2829

@@ -52,10 +53,14 @@ const fetchReleases = async () => {
5253
const jsonRelease = release.assets.find(asset =>
5354
patterns.json.test(asset.name)
5455
)
56+
const yamlRelease = release.assets.find(asset =>
57+
patterns.yaml.test(asset.name)
58+
)
5559

5660
return {
5761
core: coreRelease.browser_download_url,
5862
json: jsonRelease.browser_download_url,
63+
yaml: yamlRelease.browser_download_url,
5964
}
6065
}
6166

@@ -98,7 +103,7 @@ const get = url => {
98103
const run = async () => {
99104
const urls = await fetchReleases()
100105

101-
await exec(path.join(__dirname, 'install-dhall.sh'), [urls.core, urls.json])
106+
await exec(path.join(__dirname, 'install-dhall.sh'), [urls.core, urls.json, urls.yaml])
102107
}
103108

104109
try {

src/install-dhall.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ wget --quiet $1
66
echo "Downloading dhall-json from: $2"
77
wget --quiet $2
88

9-
# Extract dhall-json first, makes shell glob easier
9+
echo "Downloading dhall-yaml from: $3"
10+
wget --quiet $3
11+
12+
# Extract dhall-json and dhall-yaml first, makes final shell glob easier
1013
tar --extract --bzip2 --file dhall-json-*.tar.bz2
1114
rm -f dhall-json-*.tar.bz2
1215

16+
tar --extract --bzip2 --file dhall-yaml-*.tar.bz2
17+
rm -f dhall-yaml-*.tar.bz2
18+
1319
# Extract dhall now that dhall-json is done
1420
tar --extract --bzip2 --file dhall-*.tar.bz2
1521
rm -f dhall-*.tar.bz2

0 commit comments

Comments
 (0)