Closed ZaptorZap closed 3 years ago
Thanks for checking this. Indeed I messed up the shell scripts when preparing for portable mode and resaved them on Windows which explains the wrong newlines.
This is my bad and I should have checked first — I don't even have an excuse because I have a Ubuntu VM that I can spin up easily! I will reupload the v1.0.1 release with your scripts and make sure they're correct with respect to line endings going forward. And yes the read
command is not necessary, mostly a leftover from an older project.
Version
v1.0.1-20210830a
Operating System
Linux
Problem Description
Upon attempting to load
play_linux.sh
right after extracting the release found here, I was greeted by two separate yet closely related issues. First, the shell script does not hold the executable mode bit, which can be added by runningchmod +x play_linux.sh
. After adding this flag, the shell script will still fail to load with the reasoning being limited down to the choice of Windows-specific line endings, according to fish. This shell even goes on to suggest its own workaround, that being the standalone utility nameddos2unix
, which explains the discrepancy in more detail through its manpage:Since every shell I have available to myself(that being fish, bash, and dash/sh) expects the latter, this shell script does not work on any of them.
Steps to Reproduce Problem
(assuming you're on fish, although realistically the steps would be the same on bash or dash. the output would be different, however)
wget https://github.com/chrislo27/PolyrhythmMania/releases/download/v1.0.1/PolyrhythmMania_v1.0.1.zip
unzip PolyrhythmMania_v1.0.1.zip
cd PolyrhythmMania_platform_agnostic/
3.1. Attempting to run the shell script from this step (with./play_linux.sh
) would cause the following error:fish: The file “./play_linux.sh” is not executable by this user
chmod +x play_linux.sh
4.1. Attempting to run the shell script from this step (with./play_linux.sh
) will now cause the following error:Relevant log output
No response
(Optional) Other useful information
If you're curious how the error looks on bash or dash, here's the output. Ignore the claims that the file just doesn't exist. It really does! I tried with
test -e
and absolute paths and stuff.In bash:
If you don't have the time to spin up a real Unix machine just to make what's pretty much a text file, here's the script I eventually used to launch the game with. It should have
+x
set, and it definitely uses the right line breaks. Here's the portable shell script as well, since it suffers the same problem.If you ask me personally, at least as a Debian 11 user, I don't see what the point of the
read -n1 "Press any key to continue..."
line is, as thatread
command is seemingly skipped on bash/dash(sh). fish displays an error citing:`Press any key to continue...': not a valid identifier
and removing the line entirely still plays the game as normal, exiting gracefully through the menu. For completionist sake I removed the line in these regular and portable shell scripts, should you choose to use these instead. (you can't complain about the file size reductions!)