Skip to content

Commit 5f5fedb

Browse files
committed
fix: Upgrade for latest Basalt
1 parent fc19b3f commit 5f5fedb

File tree

5 files changed

+15
-71
lines changed

5 files changed

+15
-71
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bpm_packages/
1+
.basalt/

basalt.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@ authors = ['Edwin Kofler <edwin@kofler.dev>']
66
description = ''
77

88
[run]
9-
dependencies = ['hyperupcall/bash-args@e5466e6c3998790ebd99768cf0f910e161b84a95']
9+
dependencies = ['https://github.com/hyperupcall/bash-args.git@v0.9.0']
10+
sourceDirs = ['pkg/lib']
11+
builtinDirs = []
1012
binDirs = ['pkg/bin']
13+
completionDirs = []
14+
manDirs = []
15+
16+
[run.shellEnvironment]
17+
18+
[run.setOptions]
19+
20+
[run.shoptOptions]

basalt_packages/packages/github.com/hyperupcall/bash-args@e5466e6c3998790ebd99768cf0f910e161b84a95

Lines changed: 0 additions & 1 deletion
This file was deleted.

pkg/bin/choose

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,7 @@
11
#!/usr/bin/env bash
2-
# AUTOGENERATED by the 'task-Bash-generate-bins.sh' Glue action!
3-
# Do NOT edit!
42

5-
# https://github.com/bashup/realpaths
6-
realpath.location() {
7-
realpath.follow "$1"
8-
realpath.absolute "$REPLY" ".."
9-
}
3+
eval "$(basalt-package-init)"; basalt.package-init
4+
basalt.package-load
105

11-
realpath.dirname() {
12-
REPLY=.
13-
! [[ $1 =~ /+[^/]+/*$|^//$ ]] || REPLY="${1%${BASH_REMATCH[0]}}"
14-
REPLY=${REPLY:-/}
15-
}
16-
17-
realpath.follow() {
18-
local target
19-
while [[ -L "$1" ]] && target=$(readlink -- "$1"); do
20-
realpath.dirname "$1"
21-
# Resolve relative to symlink's directory
22-
[[ $REPLY != . && $target != /* ]] && REPLY=$REPLY/$target || REPLY=$target
23-
# Break out if we found a symlink loop
24-
for target; do [[ $REPLY == "$target" ]] && break 2; done
25-
# Add to the loop-detect list and tail-recurse
26-
set -- "$REPLY" "$@"
27-
done
28-
REPLY="$1"
29-
}
30-
31-
realpath.absolute() {
32-
REPLY=$PWD; local eg=extglob; ! shopt -q $eg || eg=; ${eg:+shopt -s $eg}
33-
while (($#)); do case $1 in
34-
//|//[^/]*) REPLY=//; set -- "${1:2}" "${@:2}" ;;
35-
/*) REPLY=/; set -- "${1##+(/)}" "${@:2}" ;;
36-
*/*) set -- "${1%%/*}" "${1##${1%%/*}+(/)}" "${@:2}" ;;
37-
''|.) shift ;;
38-
..) realpath.dirname "$REPLY"; shift ;;
39-
*) REPLY="${REPLY%/}/$1"; shift ;;
40-
esac; done; ${eg:+shopt -u $eg}
41-
}
42-
43-
44-
# Get the path to the 'lib' directory, which could be different depending on
45-
# the method of installation. If the user installed the program through their
46-
# distribution's package manager, the 'lib' files are in an extra subfolder
47-
# compared to an installation through Git (ex. Basher)
48-
realpath.location "${BASH_SOURCE[0]}"
49-
REPLY="${REPLY/%\/}"
50-
REPLY="${REPLY%/*}"
51-
if [ -d "$REPLY/lib/glue" ]; then
52-
PROGRAM_LIB_DIR="$REPLY/lib/choose"
53-
elif [ -d "$REPLY/lib" ]; then
54-
PROGRAM_LIB_DIR="$REPLY/lib"
55-
else
56-
echo "Error: Could not determine \$PROGRAM_LIB_DIR"
57-
exit 1
58-
fi
59-
60-
# shellcheck disable=SC1091
61-
source "$PROGRAM_LIB_DIR/cmd/choose.sh"
6+
source "$BASALT_PACKAGE_PATH/pkg/lib/cmd/choose.sh"
627
choose.main "$@"

pkg/lib/cmd/choose.sh

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ set -Eeo pipefail
66
eval "$(basalt-package-init)"; basalt.package-init
77
basalt.package-load
88

9-
# ------------------------- start ------------------------ #
10-
source "$PROGRAM_LIB_DIR/do.sh"
11-
source "$PROGRAM_LIB_DIR/helper.sh"
12-
source "$PROGRAM_LIB_DIR/plumbing.sh"
13-
source "$PROGRAM_LIB_DIR/util.sh"
14-
15-
for f in "$PROGRAM_LIB_DIR"/../../basalt_packages/packages/github.com/hyperupcall/bash-args@*/pkg/{lib/util,source}/*.sh; do
16-
source "$f"
17-
done
18-
199
db_dir="${CHOOSE_DB_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/choose/db}"
2010

2111
choose.main() {

0 commit comments

Comments
 (0)