aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/c_exec.go9
-rw-r--r--src/c_hardflip.go3
2 files changed, 7 insertions, 5 deletions
diff --git a/src/c_exec.go b/src/c_exec.go
index e00fe36..ff0ed89 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -292,12 +292,13 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
if host.Protocol == PROTOCOL_CMD {
silent = host.Silent
}
- if silent == false {
+ if silent == false && ui != nil {
if err := ui.s.Suspend(); err != nil {
c_error_mode("screen", err, ui)
return
}
- } else {
+ } else if ui != nil {
+
i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " Exec ")
text := "running command..."
left, right := i_left_right(len(text), *ui)
@@ -306,13 +307,13 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
ui.s.Show()
}
if err, err_str := c_exec_cmd(cmd_fmt, cmd_env, silent);
- err != nil && host.Protocol == PROTOCOL_CMD {
+ err != nil && host.Protocol == PROTOCOL_CMD {
c_error_mode(err_str, err, ui)
}
if opts.Loop == false {
ui.s.Fini()
os.Exit(0)
- } else if silent == false {
+ } else if silent == false && ui != nil {
c_resume_or_die(ui)
}
}
diff --git a/src/c_hardflip.go b/src/c_hardflip.go
index a50a9ae..0a203b4 100644
--- a/src/c_hardflip.go
+++ b/src/c_hardflip.go
@@ -82,7 +82,8 @@ func main() {
data := c_init_hard(data_dir, n_arg, s_arg)
if s_arg == true {
c_fuzz(data, &data.ui)
- // TODO: exec instantly here
+ c_exec(data.litems.curr.Host, data.opts, nil)
+ return
}
i_ui(data)
}