mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-29 05:16:28 -04:00
Better sanitize user input in inputInt
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/rwinkhart/MUTN/src/offline"
|
||||
"os"
|
||||
)
|
||||
|
||||
// TempInitCli initializes the MUTN environment based on user input
|
||||
@@ -14,6 +16,10 @@ func TempInitCli() {
|
||||
// select GPG key from menu
|
||||
uidSlice := offline.GpgUIDListGen()
|
||||
gpgIDInt := inputMenuGen("Select GPG key:", uidSlice)
|
||||
if gpgIDInt == 0 {
|
||||
fmt.Println(offline.AnsiError + "No GPG keys found - please generate one" + offline.AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
gpgID = uidSlice[gpgIDInt-1]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user