aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-mixtapes
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-03-02 06:00:24 +0200
committerkaotisk <kaotisk@arching-kaos.org>2024-03-02 06:00:24 +0200
commitd8543fd95a7e4519ef23ca0ea5125fcc4f860e76 (patch)
tree1b3376bd7593d308d1c7d3f0844353a82c7d3f25 /bin/ak-mixtapes
parentdcafdd7151abfed1f69407357854ae91deea0c0b (diff)
downloadarching-kaos-tools-d8543fd95a7e4519ef23ca0ea5125fcc4f860e76.tar.gz
arching-kaos-tools-d8543fd95a7e4519ef23ca0ea5125fcc4f860e76.tar.bz2
arching-kaos-tools-d8543fd95a7e4519ef23ca0ea5125fcc4f860e76.zip
Added specs subcommand
Diffstat (limited to 'bin/ak-mixtapes')
-rwxr-xr-xbin/ak-mixtapes18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/ak-mixtapes b/bin/ak-mixtapes
index 04b2490..bb030b2 100755
--- a/bin/ak-mixtapes
+++ b/bin/ak-mixtapes
@@ -7,6 +7,20 @@ _ak_modules_mixtapes_usage(){
echo "$0 - artist title file"
}
+_ak_modules_mixtapes_specs(){
+ datetime_mask=$(printf '^[0-9]\{8\}_[0-9]\{6\}$' | xxd -p)
+ ipfs_mask=$(printf '^Qm[a-zA-Z0-9]\{44\}$' | xxd -p)
+ text_dash_underscore_space_mask=$(printf '^[a-zA-Z0-9][a-zA-Z0-9[:space:]\_]\{1,128\}$' | xxd -p -c 64)
+ echo '
+ {
+ "datetime": "'$datetime_mask'",
+ "artist": "'$text_dash_underscore_space_mask'",
+ "title": "'$text_dash_underscore_space_mask'",
+ "ipfs": "'$ipfs_mask'",
+ "detach": "'$ipfs_mask'"
+ }' | jq
+}
+
_ak_modules_mixtapes_main(){
echo $MIXTAPE_FILE "by" $MIXTAPE_ARTIST "named as" $MIXTAPE_TITLE
@@ -44,5 +58,9 @@ then
_ak_modules_mixtapes_main
cat $PWD/data | jq -M
ak-zblock-pack mixtape/add $PWD/data
+elif [ "$1" == "specs" ]
+then
+ _ak_modules_mixtapes_specs
+ exit 0
else _ak_modules_mixtapes_usage
fi