Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if site_dir isn't defined in _deploy.yml when using git deployment #29

Closed
SSheldon opened this issue May 11, 2014 · 0 comments
Closed

Comments

@SSheldon
Copy link

site_dir in _deploy.yml is stated to be optional for method: git, defaulting to _site. https://github.com/octopress/deploy#git-deployment-configuration

However, if I do not have it defined and attempt to do octopress deploy or octopress deploy pull <dir> it will crash with: no implicit conversion of nil into String

This is a regression that popped up somewhere between rc5 and rc8.

Here's the full stack trace:

/usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.8/lib/octopress-deploy/git.rb:12:in `expand_path': 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.8/lib/octopress-deploy/git.rb:12:in `initialize'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.8/lib/octopress-deploy.rb:68:in `new'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.8/lib/octopress-deploy.rb:68:in `deployer'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.8/lib/octopress-deploy.rb:32:in `push'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/octopress-deploy-1.0.0.rc.8/lib/octopress-deploy/commands.rb:12:in `block (2 levels) in init_with_program'
    from /usr/local/Cellar/ruby/2.1.1/lib/ruby/gems/2.1.0/gems/mercenary-0.3.3/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.3/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.3/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.3/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.3/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.3/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.10/bin/octopress:23:in `<top (required)>'
    from /usr/local/opt/ruby/bin/octopress:23:in `load'
    from /usr/local/opt/ruby/bin/octopress:23:in `<main>'

Looks like @options[:site_dir] is nil now and File.expand_path doesn't like that https://github.com/octopress/deploy/blob/v1.0.0.rc.8/lib/octopress-deploy/git.rb#L12

Perhaps a solution would just be to pull the || 'site' into the File.expand_path call like is done with deploy_dir?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant