DFE-Digital / rails-template

Rails 7 template with GOV.UK Frontend
27 stars 5 forks source link

Make package.json scripts work with BSD commands #1

Closed peteryates closed 2 years ago

peteryates commented 2 years ago

The initial version of the postinstall script used -rT which copies recursively (-r) and ensures that the source directory isn't copied inside the target (-T)

Unfortunately, the BSD variant of cp that ships with macOS doesn't support the -T flag.

To work around this we're splitting the command into pre and post install steps; the preinstall ensures the fonts and images directories are present and the postinstall copies the files from node_modules to them.

peteryates commented 2 years ago

@chelnak - mind taking this for a spin? Turns out testing this from Linux is a bit of a faff 😅

chelnak commented 2 years ago

Nice! You beat me to it 😎

I'll spin a new app in a sec and report back!

chelnak commented 2 years ago

Works like a dream

image