location fixed for postgresql client

This commit is contained in:
2025-02-06 07:15:32 +03:00
parent c93fe755fd
commit f4f5eb06a4
8 changed files with 116 additions and 120 deletions

View File

@@ -310,11 +310,10 @@ fn (mut repo GitRepo) update_submodules() ! {
}
fn (repo GitRepo) exec(cmd_ string) !string {
import os { quoted_path }
repo_path := quoted_path(repo.path())
cmd_args := ["sh", "-c", "cd ${repo_path} && ${cmd_}"]
// console.print_debug(cmd_args.join(" "))
r := os.execute_opt(cmd_args)!
repo_path := repo.path()
cmd := 'cd ${repo_path} && ${cmd_}'
// console.print_debug(cmd)
r := os.execute(cmd)
if r.exit_code != 0 {
return error('Repo failed to exec cmd: ${cmd}\n${r.output})')
}

View File

@@ -94,20 +94,20 @@ fn (mut repo GitRepo) load_branches() ! {
// Helper to load remote tags
fn (mut repo GitRepo) load_tags() ! {
tags_result := repo.exec('git show-ref --tags') or {
return error('Failed to list tags: ${err}. Please ensure git is installed and repository is accessible.')
tags_result := repo.exec('git tag --list') or {
return error('Failed to list tags: ${err}. Please ensure git is installed and repository is accessible.')
}
//println(tags_result)
for line in tags_result.split('\n') {
line_trimmed := line.trim_space()
if line_trimmed == '' {
continue
}
if parts := line_trimmed.split(' refs/tags/') {
if parts.len != 2 {
continue
}
commit_hash := parts[0].trim_space()
tag_name := parts[1].trim_space()
line_trimmed := line.trim_space()
if line_trimmed != '' {
parts := line_trimmed.split(' ')
if parts.len < 2 {
//console.print_debug('Skipping malformed tag line: ${line_trimmed}')
continue
}
commit_hash := parts[0].trim_space()
tag_name := parts[1].all_after('refs/tags/').trim_space()
// Update remote tags info
repo.status_remote.tags[tag_name] = commit_hash