diff options
author | Joe <rbo@gmx.us> | 2024-04-11 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-11 20:20:20 +0200 |
commit | 8faca9d3d65dc575a3ca29e162fafa5a5bea025a (patch) | |
tree | e0a34fceec0b097c0dacfad46b3ee574331a058a /src/i_insert.go | |
parent | qwe (diff) | |
download | hardflip-8faca9d3d65dc575a3ca29e162fafa5a5bea025a.tar.gz hardflip-8faca9d3d65dc575a3ca29e162fafa5a5bea025a.tar.bz2 hardflip-8faca9d3d65dc575a3ca29e162fafa5a5bea025a.tar.xz hardflip-8faca9d3d65dc575a3ca29e162fafa5a5bea025a.tar.zst hardflip-8faca9d3d65dc575a3ca29e162fafa5a5bea025a.zip |
so good
Diffstat (limited to 'src/i_insert.go')
-rw-r--r-- | src/i_insert.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/i_insert.go b/src/i_insert.go index f919049..d2c7c20 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_insert.go - * Tue Apr 09 16:00:41 2024 + * Thu Apr 11 17:52:13 2024 * Joe * * insert a new host @@ -53,8 +53,8 @@ package main import ( "errors" - "fmt" "os" + "path/filepath" "regexp" "strconv" "strings" @@ -95,16 +95,20 @@ func i_insert_abs_files(insert *HostNode) { for _, v := range files { if len(*v) > 0 { - tmp := *v + if (*v)[0] == '~' { + home_dir, err := os.UserHomeDir() + if err != nil { + return + } + *v = home_dir + (*v)[1:] + } + *v, _ = filepath.Abs(*v) } } } func i_insert_host(data *HardData, insert *HostNode) { i_insert_abs_files(insert) - data.ui.s.Fini() - fmt.Println(insert.RDPFile) - os.Exit(1) filename := i_insert_format_filename(insert.Name, data.data_dir + insert.parent.path()) insert.filename = filename |