git-watchtower 1.11.7 → 1.11.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/git-watchtower.js +3 -1
- package/package.json +1 -1
- package/src/git/remote.js +6 -5
package/bin/git-watchtower.js
CHANGED
|
@@ -1097,7 +1097,9 @@ function write(str) {
|
|
|
1097
1097
|
function setTerminalTitle(title) {
|
|
1098
1098
|
// Set terminal tab/window title using ANSI escape sequence
|
|
1099
1099
|
// \x1b]0;title\x07 sets both window and tab title (most compatible)
|
|
1100
|
-
|
|
1100
|
+
// Strip control characters to prevent escape sequence injection
|
|
1101
|
+
const safe = String(title).replace(/[\x00-\x1f\x7f]/g, '');
|
|
1102
|
+
process.stdout.write(`\x1b]0;${safe}\x07`);
|
|
1101
1103
|
}
|
|
1102
1104
|
|
|
1103
1105
|
function restoreTerminalTitle() {
|
package/package.json
CHANGED
package/src/git/remote.js
CHANGED
|
@@ -71,11 +71,12 @@ function buildBranchUrl(baseUrl, host, branchName) {
|
|
|
71
71
|
function detectPlatform(webUrl) {
|
|
72
72
|
if (!webUrl) return null;
|
|
73
73
|
try {
|
|
74
|
-
const host = new URL(webUrl).hostname;
|
|
75
|
-
|
|
76
|
-
if (host === '
|
|
77
|
-
if (host === '
|
|
78
|
-
if (host === '
|
|
74
|
+
const host = new URL(webUrl).hostname.toLowerCase();
|
|
75
|
+
const parts = host.split('.');
|
|
76
|
+
if (host === 'github.com' || parts.includes('github')) return 'github';
|
|
77
|
+
if (host === 'gitlab.com' || parts.includes('gitlab')) return 'gitlab';
|
|
78
|
+
if (host === 'bitbucket.org' || parts.includes('bitbucket')) return 'bitbucket';
|
|
79
|
+
if (host === 'dev.azure.com' || host.endsWith('.visualstudio.com')) return 'azure';
|
|
79
80
|
} catch (e) { /* ignore */ }
|
|
80
81
|
return 'github'; // default assumption for self-hosted
|
|
81
82
|
}
|