-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from htw-imi-showtime/semester-tools
Added script for scaffolding new semesters
- Loading branch information
Showing
6 changed files
with
55 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+++ | ||
type = "{{ .Name }}" | ||
|
||
[cascade] | ||
type = "Bachelor" | ||
layout = "project" | ||
+++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
+++ | ||
type = "{{ .Name }}" | ||
|
||
[cascade] | ||
type = "Master" | ||
layout = "project" | ||
+++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: ./new_semester.sh <semester>" | ||
echo "Replace <semester> with a semester abbreviation, e.g. 'ws21' for 'winter semester 2021'" | ||
exit 1 | ||
fi | ||
|
||
# Check if semester is valid | ||
(echo "$1" | grep -Eq "^(ws|ss)[0-9]{2}$") || (echo "Error: Invalid semester passed" && exit 2) | ||
|
||
# Update the semester set in the config file | ||
sed -e "s/ws[0-9]\{2\}/$1/;s/ss[0-9]\{2\}/$1/" -i "" config/_default/config.toml | ||
# Create a new project folder for this semester | ||
hugo new --kind semester $1 |