Skip to content

Commit

Permalink
Fix .git suffix removal logic
Browse files Browse the repository at this point in the history
Closes #566
  • Loading branch information
0x2b3bfa0 authored May 27, 2021
1 parent 3cbbce0 commit 718d076
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cml.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const git_remote_url = (opts = {}) => {
const url = execSync(`git config --get remote.${remote}.url`).toString(
'utf8'
);
return strip_auth(git_url_parse(url).toString('https').replace('.git', ''));
return strip_auth(git_url_parse(url).toString('https'));
};

const infer_token = () => {
Expand Down Expand Up @@ -74,7 +74,7 @@ class CML {
constructor(opts = {}) {
const { driver, repo, token } = opts;

this.repo = uri_no_trailing_slash(repo || git_remote_url());
this.repo = uri_no_trailing_slash(repo || git_remote_url()).replace(/\.git$/, '');
this.token = token || infer_token();
this.driver = driver || infer_driver({ repo: this.repo });
}
Expand Down

1 comment on commit 718d076

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Comment

CML watermark

Please sign in to comment.