diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-20 11:09:55 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-20 11:09:55 +0800 |
commit | e5666ad52a5650ad80be33beeabef13d58003918 (patch) | |
tree | 8be3089935fa1403ae375d45a0fac9a01afec310 /ssh_utils.go | |
parent | deps: Bump lindenii-common (diff) | |
download | forge-e5666ad52a5650ad80be33beeabef13d58003918.tar.gz forge-e5666ad52a5650ad80be33beeabef13d58003918.tar.zst forge-e5666ad52a5650ad80be33beeabef13d58003918.zip |
hooks: Use colorful SSH messages
Diffstat (limited to '')
-rw-r--r-- | ssh_utils.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ssh_utils.go b/ssh_utils.go index 7f3188f..8ad53ab 100644 --- a/ssh_utils.go +++ b/ssh_utils.go @@ -3,8 +3,12 @@ package main import ( "context" "errors" + "fmt" + "io" "net/url" "strings" + + "go.lindenii.runxiyu.org/lindenii-common/ansiec" ) var err_ssh_illegal_endpoint = errors.New("illegal endpoint during SSH access") @@ -52,3 +56,7 @@ func get_repo_path_perms_from_ssh_path_pubkey(ctx context.Context, ssh_path stri return 0, "", false, "", "", 0, err_ssh_illegal_endpoint } } + +func wf_error(w io.Writer, format string, args ...any) { + fmt.Fprintln(w, ansiec.Red + fmt.Sprintf(format, args...) + ansiec.Reset) +} |