Skip to content

Commit

Permalink
refactor: rename variables for clarity and consistency
Browse files Browse the repository at this point in the history
docs: update comments to reflect the actual behavior of the code
  • Loading branch information
insign committed May 21, 2023
1 parent e8f22e0 commit 4ae2e65
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Same as above, but for termux.
`install_pack` and `remove_pack`
These functions are called if the system has `snap` or `flatpak` or `appimage` installed. It should install/uninstall the package using snap/flatpak/appimage. `$1` is the path to the snap/flatpak/appimage binary. You should check what is available in the system before using it. Example:
```bash
if [[ $isFlatpack == true ]]; then
if [[ $hasFlatpak == true ]]; then
$1 uninstall $xNAME # with --assumeyes
exit 1
elif [[ $hasAppImage == true ]]; then
Expand Down Expand Up @@ -329,7 +329,7 @@ readonly xDEFAULT=('apt' 'pacman' 'dnf' 'choco' 'brew' 'termux')
# $xCHANNEL
# the default channel is empty, which means the latest stable version
# user can change using -c or --channel flag
# $hasSnap, $isFlatpack, $hasAppImage
# $hasSnap, $hasFlatpak, $hasAppImage
# these boolean variables are set to true if the package manager is available and selected
# $XPM is the path to xpm executable
# $xSUDO is the sudo command, if available. Most commands already add sudo if available
Expand Down Expand Up @@ -379,9 +379,9 @@ remove_dnf() { # $1 means dnf compatible with -y, with sudo if available

# update commands will be called before install_pack and remove_pack
install_pack() { # $1 means an executable compatible with snap, flatpack or appimage
# $hasSnap, $isFlatpack, $hasAppImage are available as boolean
# $hasSnap, $hasFlatpak, $hasAppImage are available as boolean
# shellcheck disable=SC2154
if [[ $isFlatpack == true ]]; then # actually micro is not available on flatpack
if [[ $hasFlatpak == true ]]; then # actually micro is not available on flatpack
# $1 install $xNAME # with --assumeyes
return 1
elif [[ $hasAppImage == true ]]; then # actually micro is not available on appimage
Expand All @@ -393,9 +393,9 @@ install_pack() { # $1 means an executable compatible with snap, flatpack or appi
}

remove_pack() {
# $hasSnap, $isFlatpack, $hasAppImage are available as boolean
# $hasSnap, $hasFlatpak, $hasAppImage are available as boolean
# shellcheck disable=SC2154
if [[ $isFlatpack == true ]]; then # actually micro is not available on flatpack
if [[ $hasFlatpak == true ]]; then # actually micro is not available on flatpack
# $1 uninstall $xNAME # with --assumeyes
exit 1
elif [[ $hasAppImage == true ]]; then # actually micro is not available on appimage
Expand Down

0 comments on commit 4ae2e65

Please sign in to comment.