Hubs-Foundation / hubs-compose

Local development setup for Hubs
Mozilla Public License 2.0
41 stars 32 forks source link

Clone source on first init only #17

Closed keianhzo closed 1 year ago

keianhzo commented 1 year ago

Disclaimer: I'm still quite unfamiliar with all this so there is probably a much better solution for this or it might just not make sense at all.

Why

When working with containers there might be times when I want to init the contianer (after a npm ci) but I don't what to delete the source folder as that will revert it to master.

What

This PR will only clone the source on the first repo init if the source code folder doens't exist.

bryanenders commented 1 year ago

Does git clone replace the source code on your machine? On mine I get a helpful destination path … already exists and is not an empty directory message as the command noops.

bryanenders commented 1 year ago

Your Why is spot-on. We definitely want all the orchestration scripts to be idempotent.

keianhzo commented 1 year ago

Oh yep, that's right, I guess I just need to manually remove the node_modules directory in the container and do a ./bin/init again and that will trigger the npm ci. Closing as this is not the right solution.