fix: return entire url when loggingType is entire url issue #235

This commit is contained in:
Rohid
2024-08-17 11:53:25 +06:00
parent 655c225bcb
commit 1845a8aaa8

View File

@@ -237,15 +237,6 @@ class WakaTimeCore {
.replace(cleanLine.substring(projectIndicatorIndex), '')
.replace(/\/$/, '');
}
const schemaHttpExists = url.match(/^http:\/\//i);
const schemaHttpsExists = url.match(/^https:\/\//i);
let schema = '';
if (schemaHttpExists) {
schema = 'http://';
}
if (schemaHttpsExists) {
schema = 'https://';
}
const cleanUrl = url
.trim()
.replace(/(\/|@@)$/, '')
@@ -254,7 +245,7 @@ class WakaTimeCore {
if (startsWithUrl) {
return {
project: projectName,
url: schema + urlFromLine,
url,
};
}
@@ -264,7 +255,7 @@ class WakaTimeCore {
if (lineRe.test(url)) {
return {
project: null,
url: schema + urlFromLine,
url,
};
}
}