Skip to content

Commit b3be39b

Browse files
committed
listshtweaks: prefer reading local file
1 parent 32a9536 commit b3be39b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lto-shtweaks.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949

5050
### General ###
5151

52-
# List aliases and functions contained in this file, based on GitHub main
53-
# branch
52+
# List aliases and functions contained in this file. If the file is not found
53+
# in the home directory it is loaded from GitHub
5454

55-
alias listshtweaks='tweaksfile=$(curl -s https://raw.githubusercontent.com/lortordermur/lto-shtweaks/main/lto-shtweaks.sh) && echo $tweaksfile | grep "^alias " | cut -d "=" -f 1 | grep -v "^#alias" && echo $tweaksfile | grep " () {$" | tr -d "{"'
55+
alias listshtweaks='filename="$(realpath ~)/lto-shtweaks.sh"; [ -r "$filename" ] && content=$(cat $filename); [ ! -r "$filename" ] && content=$(curl -s https://raw.githubusercontent.com/lortordermur/lto-shtweaks/main/lto-shtweaks.sh); echo $content | grep "^alias " | cut -d "=" -f 1 | grep -v "^#alias" && echo $content | grep " () {$" | tr -d "{"'
5656

5757
# System information summary (requires inxi installed)
5858

0 commit comments

Comments
 (0)