linutil icon indicating copy to clipboard operation
linutil copied to clipboard

chore: Remove unwanted case

Open jeevithakannan2 opened this issue 1 year ago • 3 comments

Type of Change

  • [ ] New feature
  • [ ] Bug fix
  • [ ] Documentation update
  • [x] Refactoring
  • [ ] Hotfix
  • [ ] Security patch
  • [ ] UI/UX improvement

Description

  • Unsupported package manager is already handled in common-script.sh https://github.com/ChrisTitusTech/linutil/blob/26d0adc829ac59893666559f1c126d05b7fddc6b/core/tabs/common-script.sh#L86
  • Removed pacman from linutil-installer.sh cargo installation section as pacman case is already handled.
  • Remove snaps script is excluded as it may conflict with #756

Testing

  • No errors works as expected.

Checklist

  • [x] My code adheres to the coding and style guidelines of the project.
  • [x] I have performed a self-review of my own code.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have made corresponding changes to the documentation.
  • [x] My changes generate no errors/warnings/merge conflicts.

jeevithakannan2 avatar Oct 04 '24 11:10 jeevithakannan2

What if a different package manager is added? This PR offers no improvements to maintainability or anything of the sort, and only offers the potential for issues to come up in the future.

lj3954 avatar Oct 05 '24 00:10 lj3954

If another package manager is added it will be handled anyway. For example, if we are adding nix then we will be adding nix to most of the scripts. If nix cannot be used for a specific script then it will be handled as unsupported. Having extra bloat that will not be reached is useless anyway.

jeevithakannan2 avatar Oct 05 '24 00:10 jeevithakannan2

If nix cannot be used for a specific script then it will be handled as unsupported.

Yes. And this PR proposes the removal of that error handling.

lj3954 avatar Oct 05 '24 01:10 lj3954

Having extra bloat that cannot be reached is useless anyway 🤷🏻‍♂️ We can always add them back to scripts that don't support packagers later

jeevithakannan2 avatar Oct 05 '24 02:10 jeevithakannan2

Having extra bloat that cannot be reached is useless anyway 🤷🏻‍♂️ We can always add them back to scripts that don't support packagers later

They cannot be reached assuming all package managers supported by linutil are supported by the script. I've just stated a way in which that condition could be broken. Your idea of adding this code back in the case of any changes illustrates why removing it is a poor decision to begin with.

lj3954 avatar Oct 05 '24 06:10 lj3954