diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec3d3664bdc..b866f638954 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,7 @@ If you'd like to edit a specific devopsdays event site (and/or contribute code), 1. Have the ability to run Hugo. This can be done locally or through Docker. 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repo and clone a copy locally. +1. Check out the available [utility scripts](./utilities/README.md) to help organize your event. #### Run Hugo with Docker (Recommended) diff --git a/utilities/add_new_event.sh b/utilities/add_new_event.sh index ca9b2a323a4..f92e9f29562 100755 --- a/utilities/add_new_event.sh +++ b/utilities/add_new_event.sh @@ -36,6 +36,13 @@ twitter=$(echo $twitter | sed 's/@//') # We use the term event_slug in the hugo files too event_slug=$year-$city_slug +# Check if the event directory already exists +if [ -d "../content/events/$event_slug" ]; then + echo "The event content directory already exists:" + echo "./content/events/$event_slug" + exit 1 +fi + # Update the redirection for a previous year of this event to the desired year if grep -q "^/$city_slug" "../static/_redirects"; then @@ -46,6 +53,13 @@ else echo "/$city_slug/* /events/$event_slug/:splat 302" >> "../static/_redirects" fi +# Check if the event directory already exists +if [ -d "../data/events/$year/$city_slug" ]; then + echo "The event data directory already exists:" + echo "./data/events/$year/$city_slug" + exit 1 +fi + # Create data directory for the event mkdir -p ../data/events/$year/$city_slug # Create default event datafile