[NCP] ncp-update script running in wrong scope? Script not succeeding

Nextcloud version: 28.0.5
Operating system and version: Debian 11
PHP version: 8.1

NCP version 1.53.2

Hi community,

for a while I face the following problem when running “ncp-update”:

Downloading updates
Performing updates
/usr/local/bin/ncp-update: line 45: ./update.sh: No such file or directory

It seems as the scope in which the script is run doesn’t match the required one. When I open the script /usr/local/bin/ncp-update and run all the commands in a terminal one by one it works but I have to run “update.sh” without “./” in the terminal.
I don’t know what’s messed up here but I would be thankful if I could just run “ncp-update” again without hassling around with the scripts and running each command on its own.

Perhaps someone has a simple solution.
Thanks.

Edit:

my PATH variable is
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

perhaps the problem is in here.

Edit2:

in the script “/usr/local/bin/ncp-update” in line 32 there seems to be no cd-ing to directory $TEMPDIR so ./update.sh is truely not found. But how can the below code not do “cd “$TEMPDIR””? I don’t understand what the code snippet is supposed to check…especially the “[[ -f /.ncp-image]]” part.

  [[ -f /.ncp-image ]] || {
    cd "$TEMPDIR"         # update locally during build

    [[ -z "$2" ]] || {
      git fetch origin "$2" || {
        echo "Error: Could not fetch $2"
        exit 1
      }
      git checkout FETCH_HEAD
    }
  }