No Login Prompt on Linux, can't run sh file (SOLVED)

Hi All!

So I’ve downloaded the Linux 64bit version of the editor and it doesn’t prompt for login when running the executable. I tried running the sh file from command line, and I get this non-helpful error:

$sh Defold-linux.sh
trap: SIGINT: bad trap

Tried re-downloading and going straight to the sh file, and same error. Any suggestions?

Ok so, I had to drag the SH file into a terminal window and run it that way, rather than just typing the command. What! Anyway, it now properly shows the Welome screen, and prompts for Google login when I click open project. So… yay!

1 Like

Sorry for the issues, the only comfort I can give is that we got rid of the .sh file for editor2, i.e. you just start the app normally. From the error it seems like we could have done a better job with that .sh file too. I’m not sure what type of shell+envs you get from the sh command on your machine, did you try:
$ ./Defold-linux.sh

1 Like

Hello @avinus

The script is intended for bash which is specified in the shebang (#!/usr/bin/env bash). There are differences between bash and sh, and some distributions such as Ubuntu even symlinks sh -> dash which can add to the confusion. When you drag & drop the script to the terminal the shebang above will be examined and the script will be launched with bash.

The SIGINT: bad trap message is unfortunate since it says nothing about the actual error, but I’m suspecting that it’s because of the variable substitution in the function terminate that is executed in the trap.

The trap we’re setting looks like this
trap 'terminate 1 "Launch error: An error occurred."' SIGINT SIGTERM EXIT

And this is the terminate function

function terminate() {
  trap - SIGINT SIGTERM EXIT
  echo "${2:-Terminated.}"
  exit ${1:-1}
}

Running sh Defold-linux.sh is not necessarily the same as running ./Defold-linux.sh or /bin/bash Defold-linux.sh. Could you give me the output from which sh, which bash, sh --version and bash --version. If you could provide me with your distribution and version as well that would be great. This might be something that we should include in the FAQ.

6 Likes

Thanks for the explanations! My command line skills are only basic, so the bash option missed me. Got it working anyway. :slight_smile:

3 Likes