I suppose that’s on you. If the file isn’t executable, it opens a text editor. To fix this follow this guide:
1) open a console and cd into the directory where the .sh is stored.
2) enter following command: „chmod +x (file.sh)
3) open the file (either with double clicking or in the console: ./{file.sh}