fix: better repo handling
MODIFY
src/generators/app.ts
src/generators/app.ts
@@ -64,6 +64,7 @@ class App extends Generator {
if (bin.includes('/')) bin = bin.split('/').pop()
return bin
}
+ repository?: string
constructor(args: any, opts: any) {
super(args, opts)
@@ -121,6 +122,10 @@ class App extends Generator {
},
options: this.options,
}
+ this.repository = defaults.repository
+ if (this.repository && (this.repository as any).url) {
+ this.repository = (this.repository as any).url
+ }
try {
let yml = this.fs.read('.circleci/config.yml')
this.options['semantic-release'] = yml.includes('semantic-release')
@@ -182,7 +187,7 @@ class App extends Generator {
type: 'input',
name: 'github.user',
message: 'github owner of repository (https://github.com/OWNER/repo)',
- default: defaults.repository.split('/').slice(0, -1).pop(),
+ default: repository.split('/').slice(0, -1).pop(),
when: !this.pjson.repository,
},
{

MODIFY
templates/README.md.ejs
templates/README.md.ejs
<%= pjson.description %>
[![Version](https://img.shields.io/npm/v/<%= pjson.name %>.svg)](https://npmjs.org/package/<%= pjson.name %>)
-[![CircleCI](https://circleci.com/gh/<%= pjson.repository %>/tree/master.svg?style=svg)](https://circleci.com/gh/<%= pjson.repository %>/tree/master)
-[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/<%= pjson.repository %>?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/<%= pjson.repository.split('/').pop() %>/branch/master)
-[![Codecov](https://codecov.io/gh/<%= pjson.repository %>/branch/master/graph/badge.svg)](https://codecov.io/gh/<%= pjson.repository %>)
-[![Greenkeeper](https://badges.greenkeeper.io/<%= pjson.repository %>.svg)](https://greenkeeper.io/)
+[![CircleCI](https://circleci.com/gh/<%= repository %>/tree/master.svg?style=svg)](https://circleci.com/gh/<%= repository %>/tree/master)
+[![Appveyor CI](https://ci.appveyor.com/api/projects/status/github/<%= repository %>?branch=master&svg=true)](https://ci.appveyor.com/project/heroku/<%= repository.split('/').pop() %>/branch/master)
+[![Codecov](https://codecov.io/gh/<%= repository %>/branch/master/graph/badge.svg)](https://codecov.io/gh/<%= repository %>)
+[![Greenkeeper](https://badges.greenkeeper.io/<%= repository %>.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/<%= pjson.name %>/badge.svg)](https://snyk.io/test/npm/<%= pjson.name %>)
[![Downloads/week](https://img.shields.io/npm/dw/<%= pjson.name %>.svg)](https://npmjs.org/package/<%= pjson.name %>)
-[![License](https://img.shields.io/npm/l/<%= pjson.name %>.svg)](https://github.com/<%= pjson.repository %>/blob/master/package.json)
+[![License](https://img.shields.io/npm/l/<%= pjson.name %>.svg)](https://github.com/<%= repository %>/blob/master/package.json)

fix: better repo handling