Skip to content

Commit

Permalink
enh(git): Give more details about profile in label
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed May 4, 2024
1 parent e8bf35d commit d479aa7
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/lib/adapters/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,15 @@ export default class GitAdapter extends CachingAdapter {
}
}

getData() {
return { ...GitAdapter.getDefaultValues(), ...this.server }
getLabel():string {
const data = this.getData()
const url = new URL(data.url)
url.protocol = ''
return data.username + '@' + url.hostname + ':' + data.bookmark_file
}

normalizeServerURL(input) {
const serverURL = url.parse(input)
if (!serverURL.pathname) serverURL.pathname = ''
return url.format({
protocol: serverURL.protocol,
auth: serverURL.auth,
host: serverURL.host,
port: serverURL.port,
pathname:
serverURL.pathname +
(serverURL.pathname[serverURL.pathname.length - 1] !== '/' ? '/' : '')
})
getData() {
return { ...GitAdapter.getDefaultValues(), ...this.server }
}

cancel() {
Expand Down

0 comments on commit d479aa7

Please sign in to comment.