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

fix commit "support --git CLI option" #311

Closed
wants to merge 1 commit into from
Closed

fix commit "support --git CLI option" #311

wants to merge 1 commit into from

Conversation

webkadiz
Copy link

@webkadiz webkadiz commented Aug 2, 2019

you are great for adding --git support. But it breaks cli without specifying this option

you forgot to specify the default value for the --git option with the third argument (bin/gh-pages.js: 45)

.option('--git <git>', 'Path to git executable')

I have done it

.option('--git <git>', 'Path to git executable', 'git')

I also set the default values ​​for "tag" and "user" according to the documentation

* fixed with the third argument
  in the option method of the "commander" library
  which indicates the default value if the option is not specified in cli

* also set default values ​
  for the "tag" and "user" options as per the documentation
@nytamin
Copy link

nytamin commented Aug 7, 2019

The defaults are currently added in
https://github.com/tschaub/gh-pages/blob/master/lib/index.js#L37
although the assigning of values doesn't work (that's what my PR #309 aims to fix).

Personally, I would vote for your fix though, but only while also removing that defaults implementation.

@webkadiz
Copy link
Author

webkadiz commented Aug 7, 2019

https://github.com/tschaub/gh-pages/blob/master/lib/index.js#L37
it probably works when executed in a script and not in cli

something like that:

// some-script.js

var ghpages = require('gh-pages');

ghpages.publish('dist', {
  branch: 'master',
  repo: 'https://example.com/other/repo.git'
},  function(err) {});

@lqs469
Copy link

lqs469 commented Aug 8, 2019

This PR will fix this error in v2.1.0 when using CLI. and somebody has opened an issue about this #308

The "file" argument must be of type string. Received type undefined

That's the reason for this problem. Please merge it.

@tschaub
Copy link
Owner

tschaub commented Aug 8, 2019

Thanks for the contribution! The gh-pages@2.1.1 release includes a fix.

@tschaub tschaub closed this Aug 8, 2019
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

Successfully merging this pull request may close these issues.

4 participants