homebrew-createzap
homebrew-createzap copied to clipboard
Output %w[ord] array
Cleaner syntax, and now brew style
compliant.
Why do we need to output %w
?
Why do we need to output
%w
?
Cleaner syntax, and now
brew style
compliant.
Easier to use a word array when working with a large array of long strings, like when having to add more entries that createzap
missed… createzap
is a useful starting point, but doesn't always find everything…
zap trash: [
"~/Library/Application Support/Flux",
"~/Library/Caches/org.herf.Flux",
"~/Library/Containers/com.justgetflux.flux",
"~/Library/Cookies/org.herf.Flux.binarycookies",
"~/Library/Preferences/org.herf.Flux.plist",
]
vs
zap trash: %w[
~/Library/Application Support/Flux
~/Library/Caches/org.herf.Flux
~/Library/Containers/com.justgetflux.flux
~/Library/Cookies/org.herf.Flux.binarycookies
~/Library/Preferences/org.herf.Flux.plist
]
@danielbayley Sorry for a delay.
But I still don't understand why we should output zap trash: %w[
is zap stanza.
I couldn't found any reference to it in documentation.
Can you explain please?
@danielbayley Sorry for a delay. But I still don't understand why we should output
zap trash: %w[
is zap stanza. I couldn't found any reference to it in documentation. Can you explain please?
More info on array literals here…
I suppose it’s personal preference… The brew style
Rubocop doesn’t enforce either style, so up to you really @nrlquaker. I use the latter in my taps, as it’s easier to edit.
I want this script to create stanza with the same style as in main repo. I don't see any array literals there
I want this script to create stanza with the same style as in main repo. I don't see any array literals there
Fair enough 👌🏼