pop-os / shell

Pop!_OS Shell
GNU General Public License v3.0
4.77k stars 262 forks source link

Bash Scripts - DOS Style Line Endings #1691

Open doorz1009 opened 5 months ago

doorz1009 commented 5 months ago

(1) Issue/Bug Description: Bash scripts in repository have DOS style line endings which causes bash interpreters to fail to run scripts.

(2) Steps to reproduce (if you know):

  1. Clone repository
  2. run make local-install
  3. : `/bin/sh: 1: ./scripts/transpile.sh: not found` indicating that `sh` couldn't be found, but really it's attempting to run `/bin/sh^M` (where `^M` indicates the ASCII carriage return character)

(3) Expected behavior: Scripts located in the ./scripts/ directory should execute in all linux shells (including bash)

(4) Distribution (run cat /etc/os-release):

cat /etc/os-release
show_command_in_title_bar
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"
show_command_in_title_bar

(5) Gnome Shell version: GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

(6) Pop Shell version (run apt policy pop-shell or provide the latest commit if building locally):

commit 8e176f14029a2c3bb54c52e1e7a5c697b9eb2171

(7) Where was Pop Shell installed from: github

(8) Monitor Setup (2 x 1080p, 4K, Primary(Horizontal), Secondary(Vertical), etc): 2x 4k, horizontal 60 fps

(9) Other Installed/Enabled Extensions: None

(10) Other Notes: Love the project <3

doorz1009 commented 5 months ago

Was able to fix by opening the file in vim and executing the following for each script:

:set ff=unix

and then saving the result. This translates the line endings into only being LF rather than CRLF.