fix(cmd): improve editor selection logic in edit command
* Enhance the editor selection to check for nvim and nano before defaulting to vi. * Return an error if no suitable editor is found. fix(cmd): track unchanged units in syncup command * Add tracking for unchanged units during syncup process. * Update completion message to include count of unchanged units. fix(runtime): change command type to slice in podman container * Update command field in podmanContainer struct to be a slice of strings. * Adjust ListRunning method to join command slice into a single string for output. fix(ci): enhance release notes generation in workflow * Collect commit messages since the last tag for release notes. * Format release body to include detailed change log.
This commit is contained in:
10
cmd/edit.go
10
cmd/edit.go
@@ -21,7 +21,15 @@ func init() {
|
||||
func runEdit(cmd *cobra.Command, args []string) error {
|
||||
editor := os.Getenv("EDITOR")
|
||||
if editor == "" {
|
||||
editor = "vi"
|
||||
for _, e := range []string{"nvim", "nano", "vi"} {
|
||||
if _, err := exec.LookPath(e); err == nil {
|
||||
editor = e
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if editor == "" {
|
||||
return fmt.Errorf("no editor found; set $EDITOR")
|
||||
}
|
||||
c := exec.Command(editor, configPath)
|
||||
c.Stdin = os.Stdin
|
||||
|
||||
Reference in New Issue
Block a user