toymaker.git

commit 5ac97bf487d7fea15401edd559454009e8e8d97b

Author: Adam <git@apiote.xyz>

show latest item in /toys/$toy/$item/latest

 get.sh | 1 +


diff --git a/get.sh b/get.sh
index 52f9bf395181f1d3f8dee21d02b85ceb9e9592f3..e3c706c7afe08059a96e6e4dc269468a67389c7b 100644
--- a/get.sh
+++ b/get.sh
@@ -18,6 +18,7 @@
 show_item() {
 	toy=$1
 	item=$2
+	[ "$item" = 'latest' ] && item=$(find toys/toymaker/ -type d -mindepth 1 -maxdepth 1 | sort -n | tail -n1 | sed 's|toys/toymaker/||')
 	if [ ! -d "toys/$toy/$item" ]
 	then
 		printf 'n;'