diff --git a/scripts/.local/share/scripts/subject b/scripts/.local/share/scripts/subject index cfdd97c..8a8368e 100755 --- a/scripts/.local/share/scripts/subject +++ b/scripts/.local/share/scripts/subject @@ -1,6 +1,5 @@ #!/bin/sh - if [ $# -lt 2 ]; then echo "Usage: subject " echo "subject type 0: programming" @@ -11,10 +10,11 @@ fi name=$1 type=$2 -mkdir -p "$name"/Labs -mkdir -p "$name"/Exercises -touch "$name"/.project +formatted_name=$(echo "$name" | tr -s ' ' '_') +mkdir -p "$formatted_name"/Labs +mkdir -p "$formatted_name"/Exercises +touch "$formatted_name"/.project if [ "$type" -eq 0 ]; then - mkdir -p "$name"/Code + mkdir -p "$formatted_name"/Code fi