minetest-mods / MoreMesecons

More mesecons items
https://forum.minetest.net/viewtopic.php?f=11&t=13150
Mozilla Public License 2.0
19 stars 12 forks source link

Missing mod.conf warnings #21

Open HybridDog opened 3 years ago

HybridDog commented 3 years ago

With the newest Minetest (since https://github.com/minetest/minetest/commit/9f6167fc3bebb337ac065b638ba7222374c769d8), I get many Mods not having a mod.conf file with the name is deprecated. warnings. To fix this, I suggest that someone could replace the depends.txt with a mod.conf in each mod. A title and description for each mod could be copied from the Readme; example for the adjustable blinky plant:

name = moremesecons_adjustable_blinkyplant
title = Adjustable Blinky plant
description = Like a mesecons blinky plant, but... adjustable. Right-click to change the interval.
depends = mesecons,moremesecons_utils
optional_depends = craft_guide

Here's a bash helper function:

mtdependschange() {
    if ! [[ -f depends.txt ]]; then
        echo "No depends.txt!" >&2
        exit 1
    fi
    deps=""
    optdeps=""
    while read line; do
        if [[ "$line" =~ .*\? ]]; then
            optdeps="$optdeps,${line%\?}"
        else
            deps="$deps,$line"
        fi
    done < depends.txt
    [[ $deps = "" ]] || deps="depends = ${deps#,}\n"
    [[ $optdeps = "" ]] || optdeps="optional_depends = ${optdeps#,}\n"
    modname="name = ${PWD##*/}\n"
    echo -en "${modname}title = \ndescription = \n$deps$optdeps" > mod.conf
    trash depends.txt
}