Skip to content

Commit dcdc483

Browse files
committed
WIP: setup-util: introduce shallow actions
- `has` is now `is-installed` for easier grok - `setup-util` actions are now grouped into shallow and setup actions, which allows handling of things like the `invoke` action to not trigger `setup-util-*` actions etc; `setup-util-bash` is the larger receipient of these changers - `setup_util` is now a auto-loading function inside `util.bash` - consistent dependency and action arguments - moving to before setup iotons for important actiosn to not conflict with transpose and invoke setup options - mark dependencies in grouped installers like `setup-util-(devices|devel|docker|mediainfo|samba|trash|vscode|xcode)` to again not trigger invoke etc on dependencies - fixed some situations where `setup-util` was used instead of `setup_util` and vice versa, such as `setup-util-gh` - remove some unnecessary but helpful explicit returns - it should become a convention before reinjected - `setup-util-lsb-release` - remove unncessary setup options for `get-installations` in `setup-util-vscode`, which would cause a conflict with overlapping actions todos: - need to figure out invoke for xcode - need to do the new arg parsing - need to merge get-app, get-font, and their options - need to finish 201 status implementation to remove applicability functions
1 parent 370a204 commit dcdc483

116 files changed

Lines changed: 583 additions & 569 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

commands/git-helper

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,9 +1573,9 @@ function git_helper() (
15731573

15741574
function __review {
15751575
# @todo make this configurable
1576-
if setup-util has gitfox; then
1576+
if setup-util is-installed gitfox; then
15771577
setup-util invoke gitfox -- "$option_path" "$@" || return $?
1578-
elif setup-util has tower; then
1578+
elif setup-util is-installed tower; then
15791579
setup-util invoke tower -- "$option_path" "$@" || return $?
15801580
else
15811581
__print_error 'No supported git reviewers installed.' || :

commands/setup-git

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,17 @@ function setup_git() (
554554

555555
# if [[ -n "$GITLAB_USERNAME" ]]; then
556556
# `glab` writes to stderr, grep needed as return status is not indicative
557-
# wrap in `! (` is to catch failures in the grep, and in the glab call
558-
# setup-util-glab--optional # only install if gitlab is configured
557+
# wrap in `! (` is to catch failures in the grep, and in the glab call:
558+
# ```
559+
# setup-util-glab --optional # only install if gitlab is configured
559560
# if ! (glab auth status 2>&1 | grep --quiet --fixed-strings --regexp='Logged in to '); then
560561
# glab auth login
561562
# fi
562563
# ^ currently broken
563564
# > glab auth login
564565
# failed to read configuration: open /home/ubuntu/.config/glab-cli/.config.yml2800055398: permission denied
565566
# fi
567+
# ````
566568

567569
# =====================================
568570
# Done

commands/setup-linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ function setup_linux() (
415415
setup-util-pamac install --optional --confirm
416416
setup-util-snap install --optional --confirm
417417
setup-util-flatpak install --optional --confirm
418-
setup-util-gnome-software --install --optional --confirm
418+
setup-util-gnome-software install --optional --confirm
419419
fi
420420

421421
# upgrade all packages

commands/setup-mac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function setup_mac() (
7272

7373
# essentials
7474
setup-mac-brew "$action"
75-
# ^ setup-util-devel done as part of this
75+
# ^ `setup-util-devel` done as part of this
7676

7777
# install and upgrade mac app store apps
7878
setup-mac-appstore upstall

commands/setup-system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function setup_system() (
9090
# don't `setup-dns`, as it can cause issues on fragile environments
9191
# let users call it themselves
9292
setup-git "$action"
93-
93+
9494
# @todo `setup-utils`
9595
# if [[ $action == 'install' ]]; then
9696
# setup-util install "${SETUP_UTILS[@]}"

0 commit comments

Comments
 (0)