Skip to content

Link to source is invalid when using ssh remote [email protected]:owner/name.git #1295

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

Closed
ggrossetie opened this issue Nov 4, 2019 · 0 comments · Fixed by #1296
Closed

Comments

@ggrossetie
Copy link
Contributor

  • What version of documentation.js are you using? latest (12.1.2)
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

Please note that this bug is fixed in git-url-parse 11.1.2.

Reproduction case

$ npm init -y
$ npm i --save [email protected]

test.js

const GitUrlParse = require("git-url-parse");
console.log(GitUrlParse("[email protected]:asciidoctor/asciidoctor.js.git"));
$ node test.js
{ protocols: [ 'http' ],
  protocol: 'ssh',
  port: null,
  resource: 'github.com',
  user: 'git',
  pathname: '/:asciidoctor/asciidoctor.js.git',
  hash: '',
  search: '',
  href: 'http://[email protected]/:asciidoctor/asciidoctor.js.git',
  query: [Object: null prototype] {},
  token: '',
  toString: [Function],
  source: 'github.com',
  git_suffix: true,
  name: 'asciidoctor.js',
  owner: ':asciidoctor',
  commit: undefined,
  ref: '',
  filepathtype: '',
  filepath: '',
  organization: ':asciidoctor',
  full_name: ':asciidoctor/asciidoctor.js' }

Notice that the organization and the owner is :asciidoctor (prefixed by :).

$ npm i --save [email protected]
{ protocols: [],
  protocol: 'ssh',
  port: null,
  resource: 'github.com',
  user: 'git',
  pathname: '/asciidoctor/asciidoctor.js.git',
  hash: '',
  search: '',
  href: '[email protected]:asciidoctor/asciidoctor.js.git',
  query: [Object: null prototype] {},
  token: '',
  toString: [Function],
  source: 'github.com',
  git_suffix: true,
  name: 'asciidoctor.js',
  owner: 'asciidoctor',
  commit: undefined,
  ref: '',
  filepathtype: '',
  filepath: '',
  organization: 'asciidoctor',
  full_name: 'asciidoctor/asciidoctor.js' }

Now the organization and the owner is valid.

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 a pull request may close this issue.

1 participant