ChrisTitusTech / linutil

Chris Titus Tech's Linux Toolbox - Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks.
https://christitus.com
MIT License
2.85k stars 227 forks source link

refact: categorize dev scripts & add zed editor installation #929

Open jeevithakannan2 opened 2 weeks ago

jeevithakannan2 commented 2 weeks ago

Type of Change

Description

[!NOTE] Chores:

  • The chores are not related to this PR. Instead of creating a separate PR it was done here itself.
  • Refactor Developer-tools directory to developer-tools (Kind of annoying for developers to hold shift every time when typing D)
  • Refactor file names inside developer-tools from application-setup.sh to application.sh as all the scripts inside the directory is supposed to setup that particular application. No need of mentioning it in the name.
  • The chores are of separate commits @ChrisTitusTech If you wish not to do this we can easily revert the commits.

Testing

Checklist

nnyyxxxx commented 2 weeks ago

@jeevithakannan2 if there are any other scripts that use && with command_exists please remove all of the &&'s and make a pr

jeevithakannan2 commented 2 weeks ago

That suggestion is wrong.

nnyyxxxx commented 2 weeks ago

how so?

jeevithakannan2 commented 2 weeks ago

You suggestion is interpreted as command_exists foo1 || command_exists foo2

nnyyxxxx commented 2 weeks ago

nope

nnyyxxxx commented 2 weeks ago
command_exists() {
for cmd in "$@"; do
    export PATH="$HOME/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH"
    command -v "$cmd" >/dev/null 2>&1 || return 1
done
return 0
}

take a look

jeevithakannan2 commented 2 weeks ago

This will not check both foo1 and foo2 .It will immediately return 1 if foo1 is not found

nnyyxxxx commented 2 weeks ago

removing the && would simplify it since && is redundant due to #762 having both && and not having && is the same but, && is redundant due to #762

nnyyxxxx commented 2 weeks ago

if one is found why would it need to check the others? - > i misunderstood

This will not check both foo1 and foo2 .It will immediately return 1 if foo1 is not found

jeevithakannan2 commented 2 weeks ago

removing the && would simplify it since && is redundant due to #762 having both && and not having && is the same but, && is redundant due to #762

That's what I have explained above. #762 will work as || not as &&

nnyyxxxx commented 2 weeks ago

i have made a pr to fix this #931 , might as well change it now and reference it in the description of this one

im tripping lol

nnyyxxxx commented 2 weeks ago

ig there really is no way to fix that other than manually using &&

jeevithakannan2 commented 2 weeks ago

Oops accidentally rebased instead of merging main. Will clear this in a minute

nnyyxxxx commented 2 weeks ago

wtf

jeevithakannan2 commented 2 weeks ago

Fixed !!

cartercanedy commented 1 week ago

Oops accidentally rebased instead of merging main. Will clear this in a minute

Rebasing is often preferred, just fyi

Too many merges make git log way to complicated to understand/bisect if needed.