Update FirstRun.pm to let `kdesrc-run` call executables in subdirectories.
When a project source directory is located in a subdirectory of kde/src/
,
such as kde/src/playground/utils/basket
, or kde/src/kde/kdegames/picmi
,
the kdesrc-run
function will either not be able to locate the prefix.sh
in the respective path or it will fail to find that path in kde/usr/bin/...
This commit extends the approach of arguments expansion $@
.
-
${1##*/}
will remove any optional prefix directory:
playground/utils/basket
will be shortened tobasket
. -
${@:2:$#}
will expand the argument list but the first. It's consumed above. -
${2:+ }
inserts a space only if there is a second argument,
otherwise the"
quoting would always append a literal space to the command, e.g.picmi
instead ofpicmi
.
Edit: Separating the quoted command from the optional arguments does the same, but simpler.
This MR will allow to call a project from it's respective subdirectory, such as:
kdescr-run playground/utils/basket
but it will maintain its functionality if the project is conventionally located in kde/src/
Edited by Sebastian Engel