Structure modules

This commit is contained in:
redfast00 2021-01-31 23:05:58 +01:00
parent 62282f2131
commit 3cbc802c72
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
9 changed files with 5 additions and 1 deletions

View file

@ -12,12 +12,16 @@ if [ ! -d ./template_module ]; then
exit 1
fi
# Ask for module type
print "Type of module (puzzle/needy/info): "
read module_type
# Ask for module name
print "Name of module (e.g. Oil gauge): "
read module_name
# Determine a "clean" module name for paths: lowercase, no spaces
module="`print "$module_name" | tr [A-Z] [a-z] | sed "s/ /_/g;s/'//g"`"
module="`print "${module_type}_${module_name}" | tr [A-Z] [a-z] | sed "s/ /_/g;s/'//g"`"
# Make sure `modules` directory exists and target directory doesn't
mkdir -p modules