blob: b7612658392431191f2b224d0af5e88027ea0902 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/usr/bin/env bash
main() {
if (( $# != 2 )); then
printf 'Invalid number of parameters: %d\n' "$#"
exit 1
fi
local file="$1"
local title="$2"
local date="$(date -Id)"
mv "$file" entries/"$file"
jq "[.[], { title: \"$title\", date: \"$date\", file: \"$file\" }]" <metadata.json | sponge metadata.json
}
main "$@"
|