Replace spaces with underline in subject script
This commit is contained in:
parent
4779337530
commit
80d0d8433f
|
@ -1,6 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
if [ $# -lt 2 ]; then
|
if [ $# -lt 2 ]; then
|
||||||
echo "Usage: subject <subject name> <subject type>"
|
echo "Usage: subject <subject name> <subject type>"
|
||||||
echo "subject type 0: programming"
|
echo "subject type 0: programming"
|
||||||
|
@ -11,10 +10,11 @@ fi
|
||||||
name=$1
|
name=$1
|
||||||
type=$2
|
type=$2
|
||||||
|
|
||||||
mkdir -p "$name"/Labs
|
formatted_name=$(echo "$name" | tr -s ' ' '_')
|
||||||
mkdir -p "$name"/Exercises
|
mkdir -p "$formatted_name"/Labs
|
||||||
touch "$name"/.project
|
mkdir -p "$formatted_name"/Exercises
|
||||||
|
touch "$formatted_name"/.project
|
||||||
|
|
||||||
if [ "$type" -eq 0 ]; then
|
if [ "$type" -eq 0 ]; then
|
||||||
mkdir -p "$name"/Code
|
mkdir -p "$formatted_name"/Code
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue