ZeroNetX / ZeroNet

ZeroNetX - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.dev
Other
212 stars 32 forks source link

ZeroNet.sh uses CRLF terminators #145

Closed yanmaani closed 2 years ago

yanmaani commented 2 years ago

Step 1: Please describe your environment

Step 2: Describe the problem:

When I execute ZeroNet.sh, I get this error:

$ ./ZeroNet.sh --tor 
zsh: ./ZeroNet.sh: bad interpreter: /bin/bash^M: no such file or directory

The root cause of this appears to be the CRLF line terminators:

$ file ZeroNet.sh
ZeroNet.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators

If I switch to Unix line terminators, it works, in principle:

$ dos2unix ZeroNet.sh 
dos2unix: converting file ZeroNet.sh to Unix format...
$ file ZeroNet.sh
ZeroNet.sh: Bourne-Again shell script, ASCII text executable
$ ./ZeroNet.sh --tor
./ZeroNet.sh: line 12: runtime/bin/python3: Permission denied

(This is a different error, and should go in another issue)

Steps to reproduce:

  1. wget https://github.com/ZeroNetX/ZeroNet/releases/download/v0.7.6/ZeroNet-linux.zip
  2. unzip ZeroNet-linux.zip
  3. cd ./ZeroNet-linux
  4. chmod +x ./ZeroNet.sh
  5. ./ZeroNet.sh

Observed Results:

Expected Results:

Suggested remedy

Save ZeroNet.sh without CRLF line endings

nerd36 commented 2 years ago

@canewsin In Linux run $ dos2unix ./ZeroNet.sh before releasing package. You created it in Windows.

canewsin commented 2 years ago

@nerd36 @yanmaani fixed