node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

Create Repo + Clone it! #537

Closed ahmadawais closed 5 years ago

ahmadawais commented 6 years ago

How can I create and clone a repo in one step? I have added --clone to the ~.gh.json file on rep.new but I get this warning.

warning: You appear to have cloned an empty repository.
/Users/ahmadawais/.nvm/versions/node/v9.7.1/lib/node_modules/gh/lib/cmds/repo.js:153
                afterHooksCallback()
                ^

TypeError: afterHooksCallback is not a function
    at /Users/ahmadawais/.nvm/versions/node/v9.7.1/lib/node_modules/gh/lib/cmds/repo.js:153:17
    at /Users/ahmadawais/.nvm/versions/node/v9.7.1/lib/node_modules/gh/node_modules/github/api/v3.0.0/repos.js:319:17
    at callCallback (/Users/ahmadawais/.nvm/versions/node/v9.7.1/lib/node_modules/gh/node_modules/github/index.js:743:17)
    at IncomingMessage.<anonymous> (/Users/ahmadawais/.nvm/versions/node/v9.7.1/lib/node_modules/gh/node_modules/github/index.js:796:25)
    at IncomingMessage.emit (events.js:132:15)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:114:19)

It works but this warning looks very bad.

protoEvangelion commented 6 years ago

Hey @ahmadawais thanks for your patience on this.

I am having trouble reproducing your error.

Could you try running the same command with --verbose?

ahmadawais commented 5 years ago

Figured it out.

  1. CREATE: gh re --new "REPO_NAME" --description "DESC"
  2. CLONE: gh re --user USER_NAME --repo REPO_NAME --clone