Skip to content

Conversation

@Pedro-Appel
Copy link

_Hi, this is my first OSS contribution ever and I'm very happy to be doing for this project.

I have been developing something like this project but for personal use only, with my own preferences and to see this project evolve as it is shines my eyes._

About the feature.

I noticed that using the installer was different than other components.

  1. You could not go back.
  2. You could see file permissions.
  3. There was not enought space to show all files.

I just made a little adjustments and tested locally.

Copy link
Contributor

@Kasui92 Kasui92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest changes, gum has also been updated to version 0.17.0, which includes the ability to press 'ESC' to exit the file option selection.

However, I would suggest a more dynamic approach, still using choose.

UNINSTALLER_LIST=()
while IFS= read -r path; do
  UNINSTALLER_LIST+=("$(basename "$path" | sed 's/\.sh$//')")
done < <(find "$OMAKUB_PATH/uninstall" -mindepth 1 -maxdepth 1 -type f | sort)

CHOICE=$(gum choose "${UNINSTALLER_LIST[@]}" "<< Back" --header "Uninstall application" --height "$((${#UNINSTALLER_LIST[@]} + 2))")

if [[ "$CHOICE" == "<< Back"* ]] || [[ -z "$CHOICE" ]]; then
  # Don't uninstall anything
  echo ""
else
  [ -n "$CHOICE" ] && gum confirm "Run uninstaller?" && source "$CHOICE" && gum spin --spinner globe --title "Uninstall completed!" -- sleep 3
fi

clear
source $OMAKUB_PATH/bin/omakub

This way, the --height is also managed dynamically without passing a value that needs to be updated each time.

@Pedro-Appel Pedro-Appel requested a review from Kasui92 November 2, 2025 09:33
@Pedro-Appel
Copy link
Author

I'm currently looking to update GUM version, I think the ESC functionality is a great bonus, and the newest version has a lot of bug fixes

@Kasui92
Copy link
Contributor

Kasui92 commented Nov 3, 2025

I'm currently looking to update GUM version, I think the ESC functionality is a great bonus, and the newest version has a lot of bug fixes

Yep, the latest version of gum has significantly simplified the use of the file command.
However, even for future developments (e.g., multiple choice), choose can be a valid solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants