Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

:copydot should ignore vim swap files #1438

Open
wants to merge 1 commit into from

5 participants

@achiang

Seems fairly common to want to rake deploy while you might still be
editing a blog post in vim (which creates hidden .swp files). If you
attempt to do so, you'll trip on OSX with the following:

cp -r source/_posts/.2013-12-09-test.markdown.swp public/_posts/.2013-12-09-test.markdown.swp
rake aborted!
No such file or directory - public/_posts/.2013-12-09-test.markdown.swp

Instead, let's try to avoid copying .swp files.

See also: commit 254cdd3

@achiang achiang :copydot should ignore vim swap files
Seems fairly common to want to `rake deploy` while you might still be
editing a blog post in vim (which creates hidden .swp files). If you
attempt to do so, you'll trip on OSX with the following:

  cp -r source/_posts/.2013-12-09-test.markdown.swp public/_posts/.2013-12-09-test.markdown.swp
  rake aborted!
  No such file or directory - public/_posts/.2013-12-09-test.markdown.swp

Instead, let's try to avoid copying .swp files.

See also: commit 254cdd3
8c64b81
@parkr
Collaborator

:+1:

@tamouse

Given #1449 as well, it seems that :copydot needs a bit of work to only copy the right, true set of dot files. Is there a ways to nail this down instead of encountering edge cases along the way? Would it be politic to avoid copying dot files from underscore directories in source?

@tamouse

Also, just noticing, this would not exclude other manky files such as .*~ (editor backups), either.

@tamouse

While leaving the note above, I noticed this at https://github.com/imathis/octopress/blob/master/Rakefile#L233 . Do we really want a .gsub here or just a .sub ? We can't predict what someone who repeats the source directory name further down the path might absolutely want, but forcing it to be the destination directory name seems like it might not be what they want:

gsub: source/images/source/.something ~> public/images/public/.something
sub:   source/images/source/.something ~> public/images/source/.something

for example

@suzaku

+1

@dgmstuart

+1

Any reason this isn't getting merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2013
  1. @achiang

    :copydot should ignore vim swap files

    achiang authored
    Seems fairly common to want to `rake deploy` while you might still be
    editing a blog post in vim (which creates hidden .swp files). If you
    attempt to do so, you'll trip on OSX with the following:
    
      cp -r source/_posts/.2013-12-09-test.markdown.swp public/_posts/.2013-12-09-test.markdown.swp
      rake aborted!
      No such file or directory - public/_posts/.2013-12-09-test.markdown.swp
    
    Instead, let's try to avoid copying .swp files.
    
    See also: commit 254cdd3
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Rakefile
View
2  Rakefile
@@ -229,7 +229,7 @@ end
desc "copy dot files for deployment"
task :copydot, :source, :dest do |t, args|
- FileList["#{args.source}/**/.*"].exclude("**/.", "**/..", "**/.DS_Store", "**/._*").each do |file|
+ FileList["#{args.source}/**/.*"].exclude("**/.", "**/..", "**/.DS_Store", "**/._*", "**/.*.swp").each do |file|
cp_r file, file.gsub(/#{args.source}/, "#{args.dest}") unless File.directory?(file)
end
end
Something went wrong with that request. Please try again.