Fix "bin/run -l" to work correctly on Windows

On Windows, the script did not run correctly because of the "return"s.
Here, we use "exit" instead.

Also, there were many files with the same name but with different
extensions in the output. Now, we only print out the names using grep,
awk and sort utilities.

In addition, a description for bin/run is added to bin/README.md

Change-Id: Ifb106c89199ebc5a9debf6caef80bd1edf143b20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138514
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
Hossein 2022-08-19 11:14:32 +02:00
parent 673bff36bc
commit a6c50882fd
2 changed files with 21 additions and 4 deletions

View file

@ -3,9 +3,26 @@
Tools and scripts mostly not used during the build Tools and scripts mostly not used during the build
This direction has a number of key pieces (?) that are used during the This direction has a number of key pieces (?) that are used during the
build, or are simply generally useful. One example is build, or are simply generally useful. One example is `bin/run`.
This utility can be used to run the executables in this folder:
workdir/LinkTarget/Executable
Format of the usage is:
./bin/run application [parameters]|--list|--help
Use --list (same as -list or -l) to get the list of executables
Use --help (same as -help or -h) to get this help
Another example is:
bin/find-german-comments <directory> bin/find-german-comments <directory>
which will try to detect and extract all the German comments in a which will try to detect and extract all the German comments in a
given source code hierarchy `/` directory. given source code hierarchy `/` directory.
Please note that the associated issue [tdf#39468](https://bugs.documentfoundation.org/show_bug.cgi?id=39468) is now marked as
RESOLVED/FIXED, so don't expect many German comments.

View file

@ -26,7 +26,7 @@ print_usage()
list_executables() list_executables()
{ {
echo "Listing executables inside workdir/LinkTarget/Executable folder:" echo "Listing executables inside workdir/LinkTarget/Executable folder:"
find workdir/LinkTarget/Executable -executable -printf "%P\n" find workdir/LinkTarget/Executable -executable -printf "%P\n" | grep -v batch | awk -F. {'print $1'} | sort -u
} }
print_executable_name() print_executable_name()
@ -52,9 +52,9 @@ setdefaults()
case "$1" in case "$1" in
""|"-h"|"-help"|"--help") ""|"-h"|"-help"|"--help")
print_usage; return 1;; print_usage; exit 1;;
"-l"|"-list"|"--list") "-l"|"-list"|"--list")
list_executables; return 0;; list_executables; exit 0;;
*) print_executable_name $1;; *) print_executable_name $1;;
esac esac