Make yaml2json a proper script

This commit is contained in:
2024-04-27 16:25:42 +02:00
parent fd2d4f8bcf
commit c3d6af2471
2 changed files with 4 additions and 1 deletions

4
bin/yaml2json Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env python3
import sys, yaml, json
json.dump([d for d in yaml.safe_load_all(sys.stdin)][-1], sys.stdout, indent=4)

View File

@@ -131,7 +131,6 @@ alias twa="task add"
alias twd="task done" alias twd="task done"
alias inbox="task add +inbox" alias inbox="task add +inbox"
alias yaml2json="python3 -c 'import sys, yaml, json; json.dump([d for d in yaml.safe_load_all(sys.stdin)][-1], sys.stdout, indent=4)'"
alias json2yaml="python3 -c 'import sys, yaml, json; yaml.safe_dump(json.loads(sys.stdin.read()), stream=sys.stdout)'" alias json2yaml="python3 -c 'import sys, yaml, json; yaml.safe_dump(json.loads(sys.stdin.read()), stream=sys.stdout)'"
alias currentbranch='git rev-parse --abbrev-ref HEAD' alias currentbranch='git rev-parse --abbrev-ref HEAD'