chiubaka / generator-chiubaka-typescript-package

Yeoman generator for standard Chiubaka Technologies TypeScript packages for libraries and other such things.
1 stars 0 forks source link

For a fresh package with no GitHub history, generator exits with "branch not found" #107

Closed chiubaka closed 2 years ago

chiubaka commented 2 years ago
Error chiubaka-typescript-package 

Branch not found
Deprecation: [@octokit/request-error] `error.code` is deprecated, use `error.status`.
    at RequestError.get (/Users/dchiu/.nvm/versions/node/v16.15.1/lib/node_modules/generator-chiubaka-typescript-package/node_modules/@octokit/request-error/dist-node/index.js:57:21)
    at onError (/Users/dchiu/.nvm/versions/node/v16.15.1/lib/node_modules/yo/lib/cli.js:123:22)
    at /Users/dchiu/.nvm/versions/node/v16.15.1/lib/node_modules/yo/lib/cli.js:171:48

Likely while trying to update the GitHub repo settings. Some of these settings cannot / should not be changed until after the first push.

chiubaka commented 2 years ago

Current workaround is to add a dummy file to the GitHub repo then run the generator, then force push the changes onto the master branch.

chiubaka commented 2 years ago

Ideal approach to this is:

  1. Detect if a GitHub repo already exists for this project
  2. If it does, clone that repo into the working directory before generating anything
    1. DO NOT push generated commit to the repo directly. Let the user do that on their own.
  3. If the repo did not exist and was created by the generator, push commited changes to the repo before making edits to branch protection settings