Skip to content
This repository was archived by the owner on Mar 1, 2025. It is now read-only.

Commit 2cc1c20

Browse files
committed
Merge branch 'fox-forks-hyperupcall-perf' into dev/master
2 parents d3e688f + 4dc0017 commit 2cc1c20

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Diff for: extras/scripts/manpage_deploy.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if [ ! -d "./website/wslu/man/${wslu_ver}" ] ; then
55
cp ./docs/*.html ./website/wslu/man/${wslu_ver}
66
rm -f ./website/wslu/man/*.html
77
for f in $(ls -d ./website/wslu/man/${wslu_ver}/*.html); do
8-
fname="$(basename ${f})"
8+
fname="${f##*/}"
99
ln -s ./${wslu_ver}/${fname} ./website/wslu/man/${fname}
1010
done
1111
fi

Diff for: src/wslfetch.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ is_generic=0
44

55
help_short="wslfetch [-hvcg] [-t THEME] [-o OPTIONS]"
66

7-
PARSED_ARGUMENTS=$(getopt -a -n "$(basename "$wslu_util_name")" -o hvtcgo: --long help,version,theme,colorbar,generic,options: -- "$@")
7+
PARSED_ARGUMENTS=$(getopt -a -n "${wslu_util_name##*/}" -o hvtcgo: --long help,version,theme,colorbar,generic,options: -- "$@")
88
#shellcheck disable=SC2181
99
[ "$?" != "0" ] && help "$wslu_util_name" "$help_short"
1010

Diff for: src/wslgsu.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ if [[ "$wa_gs_commd" != "" ]] || [[ $isWakeup -eq 1 ]]; then
7373
# handling no name given case
7474
if [[ "$wa_gs_name" = "" ]]; then
7575
debug_echo "No name given, automatically generate"
76-
wa_gs_name=$(basename "$(echo "$wa_gs_commd" | awk '{print $1}')")
76+
wa_gs_name=$(echo "$wa_gs_commd" | awk '{print $1}')
77+
wa_gs_name=${wa_gs_name##*/}
7778
fi
7879
wa_gs_commd="wsl.exe -d $WSL_DISTRO_NAME -u $wa_gs_user $wa_gs_commd"
7980
wa_gs_dscp="Executing following command \`$wa_gs_name\` from $WSL_DISTRO_NAME when computer start up; Generated By WSL Utilities"

Diff for: src/wslu-header

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# Current utility
2222
wslu_util_fullpath="$0"
23-
wslu_util_name=$(basename "$wslu_util_fullpath")
23+
wslu_util_name="${wslu_util_fullpath##*/}"
2424

2525
# Version
2626
wslu_version=VERSIONPLACEHOLDER
@@ -226,7 +226,8 @@ function sysdrive_prefix {
226226
if [ "$(echo "$pt" | wc -l)" -eq 1 ]; then
227227
if [ -d "$pt/Windows/System32" ]; then
228228
hard_reset=1
229-
win_location="$(basename "$pt")"
229+
pt=${pt%/}
230+
win_location="${pt##*/}"
230231
break
231232
fi
232233
fi

Diff for: src/wslusc.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ base_converter_engine=${WSLUSC_BASE_CONVERTER_ENGINE:-"imagemagick"}
99

1010
help_short="wslusc [-IsgN] [-d SHORTCUT_FILE] [-e PATH] [-n NAME] [-i FILE] COMMAND\nwslusc [-hv]"
1111

12-
PARSED_ARGUMENTS=$(getopt -a -n "$(basename "$wslu_util_name")" -o hvd:Ie:n:i:gNs --long help,version,shortcut-debug:,interactive,path:,name:,icon:,gui,native,smart-icon -- "$@")
12+
PARSED_ARGUMENTS=$(getopt -a -n "${wslu_util_name##*/}" -o hvd:Ie:n:i:gNs --long help,version,shortcut-debug:,interactive,path:,name:,icon:,gui,native,smart-icon -- "$@")
1313
#shellcheck disable=SC2181
1414
[ "$?" != "0" ] && help "$wslu_util_name" "$help_short"
1515

@@ -93,7 +93,7 @@ if [[ "$cname_header" != "" ]]; then
9393
[ -z "$cname_header" ] && error_echo "Bad or invalid input; Aborting" 30
9494

9595
# handling no name given case
96-
new_cname=$(basename "$cname_header")
96+
new_cname="${cname_header##*/}"
9797
# handling name given case
9898
if [[ "$customname" != "" ]]; then
9999
new_cname=$customname
@@ -114,7 +114,7 @@ if [[ "$cname_header" != "" ]]; then
114114
#handling smart icon first; always first
115115
if [[ "$WSLUSC_SMART_ICON_DETECTION" == "true" ]]; then
116116
if wslpy_check; then
117-
tmp_fcname="$(basename "$cname_header")"
117+
tmp_fcname="${cname_header##*/}"
118118
iconpath="$(python3 -c "import wslpy.__internal__; print(wslpy.__internal__.find_icon(\"$tmp_fcname\"))")"
119119
echo "${info} Icon Detector found icon $tmp_fcname at: $iconpath"
120120
else
@@ -123,7 +123,7 @@ if [[ "$cname_header" != "" ]]; then
123123
fi
124124

125125
# normal detection section
126-
icon_filename="$(basename "$iconpath")"
126+
icon_filename="${iconpath##*/}"
127127
ext="${iconpath##*.}"
128128

129129
if [[ ! -f $iconpath ]]; then

0 commit comments

Comments
 (0)