From bcbc95b142b807175d0b18611eb0743564819a7d Mon Sep 17 00:00:00 2001 From: Nathan Long Date: Thu, 12 Jul 2012 05:39:30 -0400 Subject: Example repo URL - see Github issue 516 --- Rakefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index d4dcb549..1b5ece6d 100644 --- a/Rakefile +++ b/Rakefile @@ -299,7 +299,9 @@ task :setup_github_pages, :repo do |t, args| if args.repo repo_url = args.repo else - repo_url = get_stdin("Enter the read/write url for your repository: ") + puts "Enter the read/write url for your repository" + puts "(For example, 'git@github.com:your_username/your_username.github.com)" + repo_url = get_stdin("Repository url: ") end user = repo_url.match(/:([^\/]+)/)[1] branch = (repo_url.match(/\/[\w-]+.github.com/).nil?) ? 'gh-pages' : 'master' -- cgit v1.2.1 From 2b67270f960563c55dd6c66495517bccc4f7fb17 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sat, 13 Oct 2012 15:36:25 -0500 Subject: Disabled Rsync delete by default. Closes #787 --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 1b5ece6d..3addaaf2 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ require "stringex" ssh_user = "user@domain.com" ssh_port = "22" document_root = "~/website.com/" -rsync_delete = true +rsync_delete = false deploy_default = "rsync" # This will be configured for you when you run config_deploy -- cgit v1.2.1 From 49e97e53f5e92cacb05f0dd33b656d4c813d07ce Mon Sep 17 00:00:00 2001 From: Parker Moore Date: Fri, 30 Nov 2012 21:42:46 -0500 Subject: Fixing English error pet-peeve. --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 3addaaf2..8f54ae1d 100644 --- a/Rakefile +++ b/Rakefile @@ -151,7 +151,7 @@ task :new_page, :filename do |t, args| end # usage rake isolate[my-post] -desc "Move all other posts than the one currently being worked on to a temporary stash location (stash) so regenerating the site happens much quicker." +desc "Move all other posts than the one currently being worked on to a temporary stash location (stash) so regenerating the site happens much more quickly." task :isolate, :filename do |t, args| stash_dir = "#{source_dir}/#{stash_dir}" FileUtils.mkdir(stash_dir) unless File.exist?(stash_dir) -- cgit v1.2.1 From 916b87a5457e68514c95a1e5f8a0eff324bed9e8 Mon Sep 17 00:00:00 2001 From: Johan Svensson Date: Sun, 9 Dec 2012 19:04:41 +0100 Subject: Rakefile option for any additional rsync arguments Added variable `rsync_args` --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 3addaaf2..55bb57b8 100644 --- a/Rakefile +++ b/Rakefile @@ -8,6 +8,7 @@ ssh_user = "user@domain.com" ssh_port = "22" document_root = "~/website.com/" rsync_delete = false +rsync_args = "" # Any extra arguments to pass to rsync deploy_default = "rsync" # This will be configured for you when you run config_deploy @@ -237,7 +238,7 @@ task :rsync do exclude = "--exclude-from '#{File.expand_path('./rsync-exclude')}'" end puts "## Deploying website via Rsync" - ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}") + ok_failed system("rsync -avze 'ssh -p #{ssh_port}' #{exclude} #{rsync_args} #{"--delete" unless rsync_delete == false} #{public_dir}/ #{ssh_user}:#{document_root}") end desc "deploy public directory to github pages" -- cgit v1.2.1 From 65f7f7f0b3fa2264336d21a169b7ef426079dd2d Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 1 Jan 2013 14:22:48 -0600 Subject: Rake task new_post now accepts titles through stdin This should help resolve issues for zsh users and make it easier to enter titles which freak out Rake's argument processing --- Rakefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index ef9af471..6c699df3 100644 --- a/Rakefile +++ b/Rakefile @@ -92,10 +92,13 @@ end # usage rake new_post[my-new-post] or rake new_post['my new post'] or rake new_post (defaults to "new-post") desc "Begin a new post in #{source_dir}/#{posts_dir}" task :new_post, :title do |t, args| + if args.title + title = args.title + else + title = get_stdin("Enter a title for your post: ") + end raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) mkdir_p "#{source_dir}/#{posts_dir}" - args.with_defaults(:title => 'new-post') - title = args.title filename = "#{source_dir}/#{posts_dir}/#{Time.now.strftime('%Y-%m-%d')}-#{title.to_url}.#{new_post_ext}" if File.exist?(filename) abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' -- cgit v1.2.1 From 5b332f5c95f825221e2447ca4909136a162dbaae Mon Sep 17 00:00:00 2001 From: richo Date: Fri, 11 Jan 2013 23:10:08 +1100 Subject: Whitespace --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 6c699df3..2afc1a80 100644 --- a/Rakefile +++ b/Rakefile @@ -303,7 +303,7 @@ task :setup_github_pages, :repo do |t, args| if args.repo repo_url = args.repo else - puts "Enter the read/write url for your repository" + puts "Enter the read/write url for your repository" puts "(For example, 'git@github.com:your_username/your_username.github.com)" repo_url = get_stdin("Repository url: ") end -- cgit v1.2.1 From 54fb2173d18788ca5ccd39828f7030eafad353ff Mon Sep 17 00:00:00 2001 From: Vaz Allen Date: Wed, 3 Oct 2012 11:50:08 -0700 Subject: setup_github_pages: allow for clones missing .git extension --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 2afc1a80..ecf996ab 100644 --- a/Rakefile +++ b/Rakefile @@ -310,7 +310,7 @@ task :setup_github_pages, :repo do |t, args| user = repo_url.match(/:([^\/]+)/)[1] branch = (repo_url.match(/\/[\w-]+.github.com/).nil?) ? 'gh-pages' : 'master' project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : '' - unless `git remote -v`.match(/origin.+?octopress.git/).nil? + unless `git remote -v`.match(/origin.+?octopress(?:\.git)?/).nil? # If octopress is still the origin remote (from cloning) rename it to octopress system "git remote rename origin octopress" if branch == 'master' -- cgit v1.2.1 From 963eff26eb52e8622559d61ae54db38e7c101bd3 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sat, 12 Jan 2013 21:24:15 -0600 Subject: Removed unnecessary passive group from octopress origin regex --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index ecf996ab..820c5417 100644 --- a/Rakefile +++ b/Rakefile @@ -310,7 +310,7 @@ task :setup_github_pages, :repo do |t, args| user = repo_url.match(/:([^\/]+)/)[1] branch = (repo_url.match(/\/[\w-]+.github.com/).nil?) ? 'gh-pages' : 'master' project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : '' - unless `git remote -v`.match(/origin.+?octopress(?:\.git)?/).nil? + unless `git remote -v`.match(/origin.+?octopress(\.git)?/).nil? # If octopress is still the origin remote (from cloning) rename it to octopress system "git remote rename origin octopress" if branch == 'master' -- cgit v1.2.1 From 5b887fef97fe2fcabe5b7482ca3f9ba62a5eb03e Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 13 Jan 2013 10:02:54 -0600 Subject: improved regexes for setup_github_pages task --- Rakefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 820c5417..471b2277 100644 --- a/Rakefile +++ b/Rakefile @@ -308,9 +308,9 @@ task :setup_github_pages, :repo do |t, args| repo_url = get_stdin("Repository url: ") end user = repo_url.match(/:([^\/]+)/)[1] - branch = (repo_url.match(/\/[\w-]+.github.com/).nil?) ? 'gh-pages' : 'master' + branch = (repo_url.match(/\/[\w-]+\.github\.com/).nil?) ? 'gh-pages' : 'master' project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : '' - unless `git remote -v`.match(/origin.+?octopress(\.git)?/).nil? + unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil? # If octopress is still the origin remote (from cloning) rename it to octopress system "git remote rename origin octopress" if branch == 'master' -- cgit v1.2.1