OILS / devtools / yaml.sh View on Github | oilshell.org

46 lines, 23 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# ./yaml.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10log() {
11 echo "$@" >& 2
12}
13
14travis() {
15 local out='.travis.yml'
16 devtools/yaml2json.py .travis.yml.in > $out
17 log "Wrote $out"
18}
19
20sourcehut() {
21 local out='.builds/create-cache.yml'
22 devtools/yaml2json.py .builds/create-cache.yml.in > $out
23 log "Wrote $out"
24}
25
26github-actions() {
27 ### Validate and print to stdout
28 devtools/yaml2json.py .github/workflows/all-builds.yml
29}
30
31bug() {
32 # This is wrong: should be 100, not "1e2"
33
34 devtools/yaml2json.py <<EOF
35{"foo": 1e2}
36EOF
37
38 # Uh this is also wrong
39 devtools/yaml2json.py <<EOF
40%YAML 1.2
41---
42{"foo": 1e2}
43EOF
44}
45
46"$@"