cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
4.48k stars 339 forks source link

fix: ensure append is on newline with existing `.gitattributes` #1602

Closed joscha closed 1 day ago

joscha commented 1 day ago

Currently, when running devenv init in a folder that already contains a .gitignore file the first line of the additions is written at the end of the last line of the existing file. If the existing file does not end with a newline, the # Devenv comment is appened at the end of the line.

Example:

An existing .gitignore

dist

(no newline at EOF) will result in:

dist# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml