Browse code

Improved the post and init_deploy rake tasks

Brandon Mathis authored on 28/06/2011 at 02:47:40
Showing 1 changed files
... ...
@@ -20,14 +20,11 @@ desc "Initial setup for Octopress: copies the default theme into the path of Jek
20 20
 task :install, :theme do |t, args|
21 21
   # copy theme into working Jekyll directories
22 22
   theme = args.theme || 'classic'
23
-  puts "## Copying "+theme+" theme to Jekyll paths"
23
+  puts "## Copying "+theme+" theme into ./#{source_dir} ./sass and ./_plugins "
24 24
   system "mkdir -p #{source_dir}; cp -R themes/"+theme+"/source/ #{source_dir}/"
25 25
   system "mkdir -p sass; cp -R themes/"+theme+"/sass/ sass/"
26 26
   system "mkdir -p _plugins; cp -R themes/"+theme+"/_plugins/ _plugins/"
27 27
   system "mkdir -p #{source_dir}/#{posts_dir}";
28
-  puts "## Layouts, images, and javascritps from the #{theme} theme have been installed into ./#{source_dir}"
29
-  puts "## Sass stylesheet sources from the #{theme} theme have been installed into ./sass"
30
-  puts "## Plugins from the #{theme} theme have been installed into ./_plugins"
31 28
 end
32 29
 
33 30
 #######################
... ...
@@ -51,7 +48,7 @@ task :preview do
51 51
 end
52 52
 
53 53
 # usage rake post[my-new-post] or rake post['my new post'] or rake post (defaults to "new-post")
54
-desc "Begin a new post in #{source_dir}/_posts"
54
+desc "Begin a new post in #{source_dir}/#{posts_dir}"
55 55
 task :post, :filename do |t, args|
56 56
   require './_plugins/titlecase.rb'
57 57
   args.with_defaults(:filename => 'new-post')
... ...
@@ -116,14 +113,15 @@ end
116 116
 
117 117
 desc "setup _deploy folder and deploy branch"
118 118
 task :init_deploy, :branch do |t, args|
119
-  puts "Please provide a deploy branch, eg. rake init_deploy[gh-pages]" unless args.branch
119
+  puts "!! Please provide a deploy branch, eg. rake init_deploy[gh-pages] !!" unless args.branch
120
+  puts "## Creating a clean #{args.branch} branch in ./#{deploy_dir} for Github pages deployment"
120 121
   cd "#{deploy_dir}" do
121 122
     system "git symbolic-ref HEAD refs/heads/#{args.branch}"
122 123
     system "rm .git/index"
123 124
     system "git clean -fdx"
124
-    system "touch README && echo 'initial commit' >> README"
125
+    system "echo 'My Octopress Page is coming soon …' > index.html"
125 126
     system "git add ."
126
-    system "git commit -m 'Setup for deploy with Octopress'"
127
+    system "git commit -m 'My Octopress site is coming soon'"
127 128
     system "git push origin #{args.branch}"
128 129
   end
129 130
 end