~ecs/tm

ref: 0022137d89f12741ac3e6cf4173aa876cda5a726 tm/tm-object-type -rwxr-xr-x 187 bytes
0022137dEmber Sawady Fix shellcheck warnings 1 year, 10 months ago
                                                                                
1
2
3
4
5
6
7
8
#!/bin/sh

# shellcheck source=./lib.sh
. "$(dirname -- "$0")/lib.sh"
[ $# -eq 1 ] || abort "usage: tm object-type <ref>"

ref="$(tm resolve-ref "$1")" || exit 1
tm cat "$ref" | head -n1