aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_insert.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-04-25 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-04-25 20:20:20 +0200
commit80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9 (patch)
tree8be2d2ab57e42fae8335717e2cebea933e8dfa43 /src/i_insert.go
parentmove was fast too (diff)
downloadhardflip-80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9.tar.gz
hardflip-80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9.tar.bz2
hardflip-80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9.tar.xz
hardflip-80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9.tar.zst
hardflip-80e1dc0b0b8a358a1a9a04802d37ef55821e0ed9.zip
red
Diffstat (limited to '')
-rw-r--r--src/i_insert.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/i_insert.go b/src/i_insert.go
index 58fba1e..97dda36 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -132,7 +132,7 @@ func i_insert_default_users(insert *HostNode) {
}
}
-func i_insert_host(data *HardData, insert *HostNode) {
+func i_insert_host(data *HardData, insert *HostNode) error {
i_insert_abs_files(insert, data.home_dir)
i_insert_default_users(insert)
if len(insert.Drive) == 0 {
@@ -149,14 +149,14 @@ func i_insert_host(data *HardData, insert *HostNode) {
if err != nil {
c_error_mode("yaml", err, &data.ui)
data.insert = nil
- return
+ return err
}
err = os.WriteFile(data.data_dir + insert.parent.path() + filename,
fmt, 0644)
if err != nil {
c_error_mode("can't write file", err, &data.ui)
data.insert = nil
- return
+ return err
}
if data.ui.insert_method == INSERT_EDIT && data.litems.curr != nil {
tmp := e_deep_copy_host(data.insert)
@@ -164,7 +164,7 @@ func i_insert_host(data *HardData, insert *HostNode) {
data.litems.reset_id()
data.ui.mode = NORMAL_MODE
data.insert = nil
- return
+ return nil
}
// HACK: not sure if this is necessary
// if data.litems.curr.is_dir() == true {
@@ -199,6 +199,7 @@ func i_insert_host(data *HardData, insert *HostNode) {
data.litems.reset_id()
data.ui.mode = NORMAL_MODE
data.insert = nil
+ return nil
}
func i_insert_check_ok(data *HardData, in *HostNode) {