run-mozilla.sh to run-palemoon.sh

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
Veit Kannegieser
Newbie
Newbie
Posts: 5
Joined: 2019-03-23, 19:16

run-mozilla.sh to run-palemoon.sh

Unread post by Veit Kannegieser » 2021-11-27, 16:24

I would like to suggest changes to the run-mozilla.sh that is contained in the Linux builds,
and rename it to the used application, like run-palemoon.sh:
- help function (-h|--help) is no longer dead code
- guesses executable from script name, also uses that for the help page

Code: Select all

--- run-mozilla.sh	2021-09-11 22:31:37.000000000 +0100
+++ run-palemoon.sh	2021-10-20 11:47:16.193817558 +0100
@@ -5,8 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 cmdname=`basename "$0"`
 MOZ_DIST_BIN=`dirname "$0"`
-MOZ_DEFAULT_NAME="./${cmdname}-bin"
-MOZ_APPRUNNER_NAME="./mozilla-bin"
+MOZ_DEFAULT_NAME="./`echo ${cmdname} | awk 'sub(/^run-/, "") sub(/.sh$/, "")'`'"
+MOZ_APPRUNNER_NAME="${MOZ_DEFAULT_NAME}-bin"
 MOZ_PROGRAM=""
 
 exitcode=1
@@ -32,17 +32,17 @@
 echo ""
 echo "  Examples:"
 echo ""
-echo "  Run the mozilla-bin binary"
+echo "  Run the ${MOZ_DEFAULT_NAME} binary"
 echo ""
-echo "    ${cmdname} mozilla-bin"
+echo "    ${cmdname} ${MOZ_DEFAULT_NAME}"
 echo ""
-echo "  Debug the mozilla-bin binary in gdb"
+echo "  Debug the ${MOZ_DEFAULT_NAME} binary in gdb"
 echo ""
-echo "    ${cmdname} -g mozilla-bin -d gdb"
+echo "    ${cmdname} -g ${MOZ_DEFAULT_NAME} -d gdb"
 echo ""
-echo "  Run mozilla-bin under valgrind with arguments"
+echo "  Run ${MOZ_DEFAULT_NAME} under valgrind with arguments"
 echo ""
-echo "    ${cmdname} -g -d valgrind -a '--tool=memcheck --leak-check=full' mozilla-bin"
+echo "    ${cmdname} -g -d valgrind -a '--tool=memcheck --leak-check=full' ${MOZ_DEFAULT_NAME}"
 echo ""
 	return 0
 }
@@ -172,6 +172,10 @@
 while [ $# -gt 0 ]
 do
   case $1 in
+    -h | --help)
+      moz_usage
+      exit 0
+      ;;
     -g | --debug)
       moz_debug=1
       shift
Attachments
run-palemoon.sh.txt
(8.86 KiB) Downloaded 5 times

Locked