fix(pipeline): resolve SafeToAutoRun deadlock and sync freezing (v0.5.20) (#589)
This commit is contained in:
@@ -105,12 +105,13 @@ function detectProjectName() {
|
||||
if (folders && folders.length > 0) {
|
||||
const cwd = folders[0].uri.fsPath;
|
||||
try {
|
||||
const remoteUrl = cp.execSync('git remote get-url origin', {
|
||||
cwd, encoding: 'utf-8', timeout: 2000, windowsHide: true, stdio: ['ignore', 'pipe', 'ignore']
|
||||
}).toString().trim();
|
||||
const match = remoteUrl.match(/\/([^\/]+?)(?:\.git)?$/);
|
||||
if (match && match[1]) {
|
||||
return match[1].toLowerCase().replace(/[\s\-]+/g, '_');
|
||||
const gitConfigPath = path.join(cwd, '.git', 'config');
|
||||
if (fs.existsSync(gitConfigPath)) {
|
||||
const configContent = fs.readFileSync(gitConfigPath, 'utf8');
|
||||
const match = configContent.match(/url\s*=\s*.*\/([^\/]+?)(?:\.git)?$/m);
|
||||
if (match && match[1]) {
|
||||
return match[1].toLowerCase().replace(/[\s\-]+/g, '_');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user