Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default-packages doesn't install last package in file on Mac and Raspbian 12 #3382

Open
MynockSpit opened this issue Jun 29, 2024 · 1 comment

Comments

@MynockSpit
Copy link

The command for ensuring a trailing new line in the list of default packages doesn't work in Mac and Raspbian 12. Instead it silently does nothing. This means that if you fail to put a new line in the default-packages file manually, the last package is ignored.

Notes

Command in nvm.sh:

$ echo '---'; echo -e "one\ntwo" | sed -e '$a\'; echo '---'
---
one
two
---

As an example (and not a replacement!) this is what it would look like on Mac and Raspbian 12.

$ echo '---'; echo -e "one\ntwo" | sed -e $'$a\\\n\\'; echo '---'
---
one
two

---

I'm no expert by any means, but perhaps an alternative such as while IFS="" read -r p || [ -n "$p" ] would work more broadly, and also wouldn't require rewriting the file into tmp.

Operating systems and versions:

Mac OS 14.2.1 (23C71) / nvm 0.39.7
Raspbian 12 / nvm 0.39.7

@MynockSpit
Copy link
Author

Update: After a little testing, it looks like the following command works on Raspi, but not on Mac.

Raspbian:

$ echo '---'; echo -e "one\ntwo" | sed -e '$a\\'; echo '---'
---
one
two

---

Mac:

$ echo '---'; echo -e "one\ntwo" | sed -e '$a\\'; echo '---'
---
sed: 1: "$a\\
": extra characters after \ at the end of a command
---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant