From cf4af1d82551401e626ca28aa5f00e4b0821685e Mon Sep 17 00:00:00 2001 From: Haacked Date: Thu, 28 Nov 2013 19:52:03 -0800 Subject: Set the codepage to 65001 before generating --- Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rakefile b/Rakefile index 0a1cfe22..4f3360c4 100644 --- a/Rakefile +++ b/Rakefile @@ -51,6 +51,8 @@ end desc "Generate jekyll site" task :generate do raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) + puts '## Setting the codepage to 65001' + `chcp 65001` puts "## Generating Site with Jekyll" system "compass compile --css-dir #{source_dir}/stylesheets" system "jekyll" -- cgit v1.2.1 From 21d26da1b68a9b0d23bde874e113665ecff7b2ea Mon Sep 17 00:00:00 2001 From: Haacked Date: Thu, 28 Nov 2013 20:00:14 -0800 Subject: Add check for running on Windows --- Rakefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 4f3360c4..ae280ff0 100644 --- a/Rakefile +++ b/Rakefile @@ -51,8 +51,10 @@ end desc "Generate jekyll site" task :generate do raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) - puts '## Setting the codepage to 65001' - `chcp 65001` + if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil + puts '## Set the codepage to 65001 for Windows machines' + `chcp 65001` + end puts "## Generating Site with Jekyll" system "compass compile --css-dir #{source_dir}/stylesheets" system "jekyll" -- cgit v1.2.1 From 3477eaf8344f0eeeb4e7c56316d67077eb83094f Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Fri, 29 Nov 2013 20:43:32 -0800 Subject: chcp only needs to run once --- Rakefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index ae280ff0..dcd2327a 100644 --- a/Rakefile +++ b/Rakefile @@ -27,6 +27,10 @@ new_post_ext = "markdown" # default new post file extension when using the n new_page_ext = "markdown" # default new page file extension when using the new_page task server_port = "4000" # port for preview server eg. localhost:4000 +if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil + puts '## Set the codepage to 65001 for Windows machines' + `chcp 65001` +end desc "Initial setup for Octopress: copies the default theme into the path of Jekyll's generator. Rake install defaults to rake install[classic] to install a different theme run rake install[some_theme_name]" task :install, :theme do |t, args| @@ -51,10 +55,6 @@ end desc "Generate jekyll site" task :generate do raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) - if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil - puts '## Set the codepage to 65001 for Windows machines' - `chcp 65001` - end puts "## Generating Site with Jekyll" system "compass compile --css-dir #{source_dir}/stylesheets" system "jekyll" -- cgit v1.2.1