diff mbox series

[bug#53063,wip-harden-installer,14/14] installer: Add confirmation page when running external commands.

Message ID 393a78f61a46d3030a8d8bde9d415d031bb4f190.1641507696.git.dev@jpoiret.xyz
State Accepted
Headers show
Series General improvements to the installer | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Josselin Poiret Jan. 6, 2022, 10:48 p.m. UTC
* gnu/installer/newt.scm (newt-run-command): Add it.
---
 gnu/installer/newt.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/gnu/installer/newt.scm b/gnu/installer/newt.scm
index fc851339d1..4830667d4d 100644
--- a/gnu/installer/newt.scm
+++ b/gnu/installer/newt.scm
@@ -80,6 +80,16 @@  (define (exit-error file report key args)
   (clear-screen))
 
 (define (newt-run-command . args)
+  (define displayed-command
+    (string-join
+     (map (lambda (s) (string-append "\"" s "\"")) args)
+     " "))
+  (run-confirmation-page
+   (format #f "The installer will run the following command:~%~a~%"
+           displayed-command)
+   "External command"
+   #:exit-button-procedure (lambda ()
+                             (abort-to-prompt 'installer-step 'abort)))
   (newt-suspend)
   (clear-screen)
   (define result (run-command args))