Add on-load hook#2010
Conversation
f99ee20 to
1e87771
Compare
1e87771 to
ceb5c4a
Compare
|
@joelim-work Please take a look again. |
joelim-work
left a comment
There was a problem hiding this comment.
Looks good, thanks for the changes
|
Hi @CatsDeservePets I was testing this with the Creating the
To handle this, I think the example
EDIT: I ended up doing something like this: set info custom:size
set watch true
cmd on-load &{{
dir="$(dirname "$1")"
[ "$(basename "$dir")" != .git ] || exit 0
cd "$dir" || exit 1
git rev-parse >/dev/null 2>&1 || exit 0
cmds=""
for file in "$@"; do
[ "$(basename "$file")" != .git ] || continue
status=$(git status --porcelain --ignored -- "$file" | cut -c1-2 | head -n1)
if [ -n "$status" ]; then
cmds="${cmds}addcustominfo ${file} \"$status\"; "
else
cmds="${cmds}addcustominfo ${file} ''; "
fi
done
lf -remote "send $id :$cmds"
}} |
|
@joelim-work cmd on-load &{{
cd "$(dirname "$1")" || exit 1
[ "$(git rev-parse --is-inside-git-dir 2>/dev/null)" = false ] || exit 0
cmds=""
for file in "$@"; do
case "$file" in
*/.git|*/.git/*) continue;;
esac
status=$(git status --porcelain --ignored -- "$file" | cut -c1-2 | head -n1)
if [ -n "$status" ]; then
cmds="${cmds}addcustominfo ${file} \"$status\"; "
else
cmds="${cmds}addcustominfo ${file} ''; "
fi
done
lf -remote "send $id :$cmds"
}} |
|
@CatsDeservePets Nice, I didn't know about Anyway I've added your changes in #2016, thanks once again. |
This pull request adds the
on-loadhook command as discussed in #1994.I will provide examples later in combination with
addcustominfo.