Files
comp126/scripts/new.sh
2024-10-10 13:21:51 -04:00

31 lines
501 B
Bash
Executable File

#!/bin/zsh
source scripts/common.sh
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <assignment/practice> <project_name>"
exit 1
fi
if [ "$1" = "assignment" ]; then
DIR=$ASSIGNMENT_DIR
elif [ "$1" = "practice" ]; then
DIR=$PRACTICES_DIR
else
echo "Usage: $0 <assignment/practice> <project_name>"
exit 1
fi
cd $DIR
mkdir -p $2
cd $2
touch index.html
mkdir -p css
cd css
cp $SHARED_DIR/common.css .
echo "@import 'common.css';" >shared.css
echo "@import 'shared.css';" >index.css