Mudlet / installers

Windows, macOS and Linux installers for Mudlet.
0 stars 8 forks source link

[MacOs] error in osx/make-installer.sh #84

Open SlySven opened 3 years ago

SlySven commented 3 years ago

I have just cloned this repository prior to submitting some changes and I spotted a shell script logic error in PR #82 :

In the following:

 perl -pi -e "s|build/.*Mudlet.*\\.app|build/${app}|i" appdmg/mudlet-appdmg.json
+if [ -z "${ptb}" ]; then
+  perl -pi -e "s|icons/.*\\.icns|icons/mudlet_ptb.icns|i" appdmg/mudlet-appdmg.json
+else
+  if [ -z "${release}" ]; then
+    perl -pi -e "s|icons/.*\\.icns|icons/mudlet_dev.icns|i" appdmg/mudlet-appdmg.json
+  else
+    perl -pi -e "s|icons/.*\\.icns|icons/mudlet.icns|i" appdmg/mudlet-appdmg.json
+  fi
+fi

the test condition in the first if is wrong. the -z argument to test (or it's [ alias) returns true if the following argument is an empty string, the test for a non-empty one is -n. Given that ptb is set to "yep" if it suppose to be a public test build then the outer if will branch to the else case where the absence of the release build option will cause the development build option to be made.

SlySven commented 3 years ago

Well, it might help if there was an M so that I could RTF thing: I've ".. use the source, Luke!" and it now seems this script is invoked in three different ways and the argument options are a little more complex than I at first thought, they are:

I will return to this once I have properly thunk it out...