Skip to content

Instantly share code, notes, and snippets.

@natanfelles
Created July 18, 2017 19:38
Show Gist options
  • Save natanfelles/af50d5064878487a7589b963848da6cd to your computer and use it in GitHub Desktop.
Save natanfelles/af50d5064878487a7589b963848da6cd to your computer and use it in GitHub Desktop.
Serve Jekyll According to Environment
#!/bin/bash
# Author: Natan Felles <[email protected]>
# Description: Serve Jekyll According to Environment
echo -n "Environment [d = development, p = production]: "
read ENV
rm -r .sass-cache/
rm -r _site/
rm .jekyll-metadata
rm Gemfile.lock
if [[ $ENV != "p" ]]; then
echo "Building development site:"
JEKYLL_ENV=development bundle exec jekyll serve --config _config_dev.yml --incremental
else
echo "Building production site:"
JEKYLL_ENV=production bundle exec jekyll serve --incremental
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment