Fixes running Jekyll preview in devcontainer (#9920)

This commit is contained in:
Franck Nijhof 2019-07-20 00:28:10 +02:00 committed by Paulus Schoutsen
parent 6c3a65edb5
commit 16f647642c
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,9 @@ ENV DEBIAN_FRONTEND=noninteractive
# Use Bash as the default shell
ENV SHELL=/bin/bash
# Set an environment variable to be able to detect we are in dev container
ENV DEVCONTAINER=true
# Locale env vars
ENV \
LANG=en_US.UTF-8 \

View File

@ -89,6 +89,7 @@ end
desc "preview the site in a web browser"
task :preview, :listen do |t, args|
listen_addr = args[:listen] || '127.0.0.1'
listen_addr = '0.0.0.0' unless ENV['DEVCONTAINER'].nil?
raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir)
puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}"
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")