kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

run_hook queue: arg3 is one increment to high #243

Closed sdsddsd1 closed 3 years ago

sdsddsd1 commented 3 years ago

Description

Using the queue hook to set terminal title. The value for arg3(number in queue) is one increment to high E.g building 1 package , arg3 returns 2.

Expected behavior

arg3(number in queue) returns the position in queue. E.g building 1 package, arg3 returns 1.

$3 returns 1 increment to high.

#!/bin/sh                                                                                                                                                                 

case $1 in                                                                                                                                                                
    queue)                                                                                                                                                                                                                                                                     
            printf '\033]0;kiss: %s (%d/%d)\a' \                                                                                                                          
                "$2" "$3" "$4" >&2                                                                 
    ;;                                                                                                                                                                    
esac 

Packagemanager´s internal variable returns the expected value

#!/bin/sh                                                                                                                                                                 

case $1 in                                                                                                                                                                
    queue)                                                                                                                                                                                                                                                                       
            printf '\033]0;kiss: %s (%d/%d)\a' \                                                                                                                          
               "$2" "$((_build_cur += 1))" "$4" #arg3, number in queue is "1" no hight. Use the pkg internal variable.
    ;;                                                                                                                                                                    
esac 


## Verbose log

1. Run `env KISS_PROMPT=0 sh -x kiss <arguments> > log 2>&1`
2. Upload the contents of `log`.
sdsddsd1 commented 3 years ago

thanks.

dylanaraps commented 3 years ago

Released a new version too. :)