diff --git a/README.md b/README.md index 67af61f..1a9ef16 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,9 @@ and * [GitLab](https://gitlab.com/) * [BitBucket](https://bitbucket.org/) * ~~[GitCafe](https://gitcafe.com/)~~ Merged into coding.net. -* [OSC](https://git.oschina.net/) * [Coding](https://coding.net/) +* [OSC](https://git.oschina.net/) +* [CSDN](https://code.csdn.net/) * Custom If you use [GitBucket](https://github.com/takezoe/gitbucket), @@ -85,9 +86,12 @@ $ gitopen @hotoo/gitopen # https://github.com/hotoo/gitopen ## Configuration Default support [github.com](https://github.com/), -[bitbucket.org](https://bitbucket.org/), [gitlab.com](https://gitlab.com/), -~~[gitcafe.com](https://gitcafe.com/)~~, [git.oschina.net](https://git.oschina.net/) -and [coding.net](https://coding.net/). +[bitbucket.org](https://bitbucket.org/), +[gitlab.com](https://gitlab.com/), +~~[gitcafe.com](https://gitcafe.com/)~~, +[coding.net](https://coding.net/) +[git.oschina.net](https://git.oschina.net/) +and [CSDN](https://code.csdn.net/). If you use [GitHub Enterprise](https://enterprise.github.com/), [GitLab Community Edition (CE), GitLab Enterprise Edition (EE)](https://gitlab.org/), diff --git a/lib/gitopenrc b/lib/gitopenrc index 58000ef..55ecaf2 100644 --- a/lib/gitopenrc +++ b/lib/gitopenrc @@ -18,5 +18,9 @@ module.exports = { "coding.com": { protocol: "https", type: "coding" - } + }, + "code.csdn.net": { + protocol: "https", + type: "csdn" + }, }; diff --git a/lib/scheme/csdn.js b/lib/scheme/csdn.js new file mode 100644 index 0000000..0e1b887 --- /dev/null +++ b/lib/scheme/csdn.js @@ -0,0 +1,31 @@ +'use strict'; +module.exports = { + 'base': '{protocol}://{hostname}/{username}/{reponame}', + 'home': '', + 'issues': '/issues', + 'issues/id': '/issues/{issue-id}', + 'issues/new': '/issues/new', + 'issues/new?title': '/issues/new?title={title}', + 'wiki': '/wikis', + 'network': '/graph', + 'tree': '/tree/{hash}{path}', + 'blob': '/tree/{hash}{path}', + 'commit': '/commit/{hash}', + 'commits': '/commits', + 'commits-with-branch': '/commits/{branch-name}', + 'branches': '/repository/branches', + 'milestones': '', + 'milestones/new': '', + 'milestones/id': '', + 'tags': '/tags', + 'releases': '/releases', + 'releases/new': '/releases/new', + 'releases/new-with-tag': '/releases/new?tag={tag}', + 'releases/edit/tag-id': '/releases/edit/{tag}', + 'pulls': '/merge_requests', + 'pulls/id': '/merge_requests/{pull-id}', + 'pulls/new': '/compare', + 'pulls/new-with-compare-branch': '/compare/{branch-B}?expand=1', + 'pulls/new-with-base-branch': '/compare/{branch-A}...{branch-B}', + 'snippets/new': '{protocol}://{hostname}/snippets_manage', +}; diff --git a/lib/scheme/oschina.js b/lib/scheme/oschina.js index 0ffa22d..d974a5d 100644 --- a/lib/scheme/oschina.js +++ b/lib/scheme/oschina.js @@ -1,6 +1,4 @@ 'use strict'; - -// https://code.csdn.net/ module.exports = { 'base': '{protocol}://{hostname}/{username}/{reponame}', 'home': '', @@ -15,7 +13,7 @@ module.exports = { 'commit': '/commit/{hash}', 'commits': '/commits/master', 'commits-with-branch': '/commits/{branch-name}', - 'branches': '/repository/branches', + 'branches': '/branches', 'milestones': '/milestones', 'milestones/new': '/milestones/new', 'milestones/id': '/milestones/{milestone-id}',