1
0
minetest-skindb-skindata/misc/set_meta_missing.sh
mckaygerhard 01589db04d fill missing license in each meta files for older format
* all files from isaiah658 are CC0
* rest of files assumed CC-BY-SA-NC-3.0
* update LICENSE with missing blender file (already in history git repo)
2024-04-03 13:50:31 -04:00

51 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
###################################################################
#Script Name : set_meta_missing.sh
#Description : fill missing key into the meta file information
#Args : none
#Author : PICCORO Lenz McKAY @mckaygerhard
#information : https://codeberg.org/mckaygerhard
###################################################################
# Warning:
# -------
# this script will fill missin information of the
# already meta fils that already has "key = value" format,
# for converting the new format, must use the set_meta_newtoold.sh
# for comverting to new format, must use the set_meta_oldtonew.sh
# this must be running from this directory and meta must be in upper same hierarchy
MODELS=$(ls ../meta/*.txt)
for il in $MODELS
do
NAM=$(grep name $il | cut -d'"' -f2)
AUT=$(grep author $il | cut -d'"' -f2)
DES=$(grep description $il | cut -d'"' -f2)
COM=$(grep comment $il | cut -d'"' -f2)
LIC=$(grep license $il | cut -d'"' -f2)
echo "$il : name $NAM, authot $AUT, description $DES, comment $COM, license $LIC"
if [ -z "$COM" ]
then
COM="$NAM made by $AUT"
LIC="CC-BY-NC-SA-3.0"
echo 'comment = "'$LIC' '$COM'",' >> $il
LIC=""
fi
if [ -z "$DES" ]
then
DES="$NAM made by $AUT"
echo 'description = "'$DES'",' >> $il
fi
if [ -z "$LIC" ]
then
LIC="CC-BY-NC-SA-3.0"
echo 'license = "'$LIC'",' >> $il
fi
echo "$il : name $NAM, authot $AUT, comment $COM, description $DES, license $LIC"
done