mirror of
https://github.com/wavetermdev/inshellisense.git
synced 2026-08-05 13:43:30 -07:00
fix: clac logging error if first command execution is canceled early (cache file doesn't exist)
Signed-off-by: Chapman Pendery <cpendery@vt.edu>
This commit is contained in:
+7
-7
@@ -36,13 +36,6 @@ func init() {
|
||||
}
|
||||
|
||||
func rootExec(cmd *cobra.Command, args []string) error {
|
||||
if outputCmd {
|
||||
result := autocomplete.ReadResult()
|
||||
_, err := os.Stdout.WriteString(result)
|
||||
return err
|
||||
}
|
||||
autocomplete.ClearResult()
|
||||
|
||||
if enableLogging {
|
||||
f, err := tea.LogToFile("clac.log", "debug")
|
||||
if err != nil {
|
||||
@@ -53,6 +46,13 @@ func rootExec(cmd *cobra.Command, args []string) error {
|
||||
slog.SetDefault(slog.New(slog.NewTextHandler(io.Discard, nil)))
|
||||
}
|
||||
|
||||
if outputCmd {
|
||||
result := autocomplete.ReadResult()
|
||||
_, err := os.Stdout.WriteString(result)
|
||||
return err
|
||||
}
|
||||
autocomplete.ClearResult()
|
||||
|
||||
startingInput := ""
|
||||
if len(args) >= 1 {
|
||||
startingInput = args[0]
|
||||
|
||||
Reference in New Issue
Block a user