21 lines
403 B
Bash
Executable File
21 lines
403 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "Usage: subject <subject name> <subject type>"
|
|
echo "subject type 0: programming"
|
|
echo "subject type 1: no programming"
|
|
exit 1
|
|
fi
|
|
|
|
name=$1
|
|
type=$2
|
|
|
|
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 "$formatted_name"/Code
|
|
fi
|