Skip to content

Commit

Permalink
Fix .git suffix removal logic (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored and casperdcl committed May 27, 2021
1 parent 70c71e0 commit 076bd5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/cml.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const gitRemoteUrl = (opts = {}) => {
const url = execSync(`git config --get remote.${remote}.url`).toString(
'utf8'
);
return stripAuth(gitUrlParse(url).toString('https').replace('.git', ''));
return stripAuth(gitUrlParse(url).toString('https'));
};

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

this.repo = uriNoTrailingSlash(repo || gitRemoteUrl());
this.repo = uriNoTrailingSlash(repo || gitRemoteUrl()).replace(
/\.git$/,
''
);
this.token = token || inferToken();
this.driver = driver || inferDriver({ repo: this.repo });
}
Expand Down

1 comment on commit 076bd5b

@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.