mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: git url contains \n
This commit is contained in:
parent
c65e2d1dc6
commit
866cffd38e
1 changed files with 3 additions and 1 deletions
|
|
@ -9,7 +9,9 @@ const { logger } = require('./log');
|
|||
const i18n = require('./i18n');
|
||||
|
||||
const getGitUrlWithCredential = (rawUrl, username, accessToken) =>
|
||||
trim(`${rawUrl}.git`.replace('https://github.com/', `https://${username}:${accessToken}@github.com/`));
|
||||
trim(
|
||||
`${rawUrl}.git`.replace(/\n/g, '').replace('https://github.com/', `https://${username}:${accessToken}@github.com/`),
|
||||
);
|
||||
const getGitUrlWithOutCredential = urlWithCredential => trim(urlWithCredential.replace(/.+@/, 'https://'));
|
||||
/**
|
||||
* Add remote with credential
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue