mirror of
https://github.com/rwinkhart/artix-install-script.git
synced 2026-08-27 20:36:26 -04:00
Make histclean show changes in file size, remove itself from history
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
echo 'Starting history size:'
|
||||
ls -lh ~/.cache/zsh-histfile | cut -d " " -f5
|
||||
|
||||
hist=()
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [[ $line == "./"* || $line == "/"* ]]; then
|
||||
hist+=($line)
|
||||
else
|
||||
elif [[ $line != "histclean" ]]; then
|
||||
which $(echo $line | cut -d " " -f1) > /dev/null
|
||||
[[ $? == 0 ]] && hist+=($line)
|
||||
fi
|
||||
@@ -15,3 +18,6 @@ echo -n "" > "$XDG_CACHE_HOME"/zsh-histfile
|
||||
for item in "${hist[@]}"; do
|
||||
echo "$item" >> "$XDG_CACHE_HOME"/zsh-histfile
|
||||
done
|
||||
|
||||
echo 'Ending history size:'
|
||||
ls -lh ~/.cache/zsh-histfile | cut -d " " -f5
|
||||
|
||||
Reference in New Issue
Block a user