Skip to content

Commit de0af16

Browse files
committed
Update README demo
1 parent 14fc9f9 commit de0af16

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,33 @@ Say good bye to learning new tools just to work with a different data format.
2222

2323
Dasel uses a standard selector syntax no matter the data format. This means that once you learn how to use dasel you immediately have the ability to query/modify any of the supported data types without any additional tools or effort.
2424

25-
![Update Kubernetes Manifest](update_kubernetes.gif)
25+
![Update Kubernetes Manifest](demo.gif)
26+
<details>
27+
<summary>Commands executed in the demo</summary>
28+
29+
```bash
30+
# Piping data into dasel
31+
echo '{"demo": "Integrating with github releases..."}' | dasel -r json 'demo'
32+
33+
# Fetch dasel releases from github api
34+
curl -L \
35+
-H "Accept: application/vnd.github+json" \
36+
-H "X-GitHub-Api-Version: 2022-11-28" \
37+
https://api.github.com/repos/TomWright/dasel/releases > releases.json
38+
less releases.json
39+
40+
# Extract and structure release data by version with download URL's by asset name
41+
dasel -f releases.json -w yaml 'all().mapOf(version,tag_name,download,assets.all().mapOf(name,name,url,browser_download_url).merge()).merge()' > releases_download.yaml
42+
less releases_download.yaml
43+
44+
# Restructure the above data into CSV format, destructuring into rows.
45+
dasel -f releases_download.yaml -w csv 'all().download.all().mapOf(version,parent(2).version,name,name,url,url).merge()' > releases_download.csv
46+
less releases_download.csv
47+
48+
# Fetch the first CSV row and output as JSON
49+
dasel -f releases_download.csv -w json 'first()'
50+
```
51+
</details>
2652

2753
## Table of contents
2854

demo.gif

1.51 MB
Loading

update_kubernetes.gif

-4.61 MB
Binary file not shown.

0 commit comments

Comments
 (0)