Skip to content

Commit

Permalink
symlink
Browse files Browse the repository at this point in the history
  • Loading branch information
papajoker committed Apr 10, 2023
1 parent fe0f91a commit df43c34
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pachook
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# packhook : a simple pacman hooks administrator
#
# Copyright (c) 2016 papajoker <[email protected]>
# Copyright (c) 2016-2023 papajoker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -18,7 +18,7 @@
#
#set -x
declare -r pkgname='packhook'
declare -r version=0.1.3
declare -r version=0.1.4

declare -A hooks
declare -r CG='\033[0m\033[32m'
Expand Down Expand Up @@ -56,7 +56,7 @@ goodext(){

list(){
declare dir="$1" fileh=''
for fileh in $(find "${dir}" -maxdepth 1 -type f -printf "%f\n"); do
for fileh in $(find -L "${dir}" -maxdepth 1 -type f -printf "%f\n"); do
hooks[${fileh%.*}]="${dir}${fileh}"
done
}
Expand Down Expand Up @@ -132,6 +132,7 @@ hook.view(){

hookbin=$(awk -F'=' '/^Exec/ { print $2}' "${fileh}" | xargs)
hookbin="${hookbin%% *}"
hookbin="$(readlink -ens "$hookbin")"
if [[ -r "${hookbin}" && $(file -bi "${hookbin}") =~ 'text' ]]; then
echo -e "\n$pre#${hookbin}$CE"
cat "${hookbin}"
Expand Down

0 comments on commit df43c34

Please sign in to comment.