octopress / deploy

Deployment for Octopress and Jekyll blogs.
MIT License
75 stars 23 forks source link

No default directory for pull #20

Closed SSheldon closed 10 years ago

SSheldon commented 10 years ago

The pull command's help states that a default directory of ./site-pull will be used:

$ octopress deploy pull --help
octopress deploy pull -- Pull down the published copy of your site into a directory (default: ./site-pull)

However, this isn't actually true! If you don't supply a directory, you instead get this error:

$ octopress deploy pull --trace
/usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.2/lib/octopress-deploy.rb:40:in `exists?': no implicit conversion of nil into String (TypeError)
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.2/lib/octopress-deploy.rb:40:in `pull'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.2/lib/octopress-deploy/commands.rb:21:in `block (3 levels) in init_with_program'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary/command.rb:220:in `call'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary/command.rb:220:in `block in execute'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary/command.rb:220:in `each'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary/command.rb:220:in `execute'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary/program.rb:35:in `go'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.2/lib/mercenary.rb:22:in `program'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-3.0.0.rc.4/bin/octopress:18:in `<top (required)>'
    from /usr/local/opt/ruby/bin/octopress:23:in `load'
    from /usr/local/opt/ruby/bin/octopress:23:in `<main>'

This scary error happens because nil is set in the options directory and then it is used as an argument to File.exists? in the self.pull method of octopress-deploy.rb.

imathis commented 10 years ago

Ah thanks for catching this. It used to have a default directory, but when I incorporated things in the Octopress CLI with Mercenary that changed. I'll update the docs. A directory will be required.

imathis commented 10 years ago

This was taken care of with the latest release. RC3 is out.

SSheldon commented 10 years ago

:+1: Nice!