Skip to content

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

Closed

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugsOh no, something's broken :-(Oh no, something's broken :-(

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions