Closed BrettMayson closed 1 year ago
Related to this - I'd like to make hemtt.json totally optional for e.g, hemtt sign
in #41, which would pave the way for hemtt unpack
etc.
Here's a non-portable way of getting an authors array which might help thinking about it in Rust:
echo "[";
# Get all authors arrays
grep -F "authors[] =" **config.cpp |\
# Extract the authors providing that they aren't foreign (fix later)
grep -o '\{.*\}' | grep -Eo '[A-Za-z0-9]+[ A-Za-z0-9]*' |\
# Sort them by the number of times they appear
sort | uniq -c | sort -r | tr -s ' ' | cut -d' ' -f3- |\
# Stick commas around them
sed 's|^\(.*\)$|"\1",|g';
echo "]"
./hemtt init
should try to auto-detect the name, prefix, and author of the project by looking in common places.Potentially even make them optional if the values can be found.