callawaycloud / generator-ccc

Yeoman Generator for Callaway Cloud Salesforce Projects
19 stars 8 forks source link

Don't clobber existing formatting in .gitignore #17

Closed ralphcallaway closed 4 years ago

ralphcallaway commented 4 years ago

version: 1.1.0

would be nice if the new lines didn't get chomped, better ergonomics :-p

if you start with this

# yarn files
yarn-debug.log*
yarn-error.log*

# sfdx git:package deploy artifacts
deploy
dist

# MacOS system files
.DS_Store

you end with this (new lines get chomped)

# yarn files
yarn-debug.log*
yarn-error.log*
# sfdx git:package deploy artifacts
deploy
dist
# MacOS system files
.DS_Store
ChuckJonas commented 4 years ago

https://github.com/ChuckJonas/generator-ccc/blob/master/generators/app/index.ts#L146

As you can see the current code just: 1: splits on newlines 2: passes it to a set, with default ignores 3: then writes back out using the set

I guess it would be better if we still built the set, but instead checked for each of the default entries in the set and append anything that's missing.

ralphcallaway commented 4 years ago

that's what i was thinking, felt bad submitting it since fixing it was marginally longer than writing the repo steps

ChuckJonas commented 4 years ago

done