Hey there, I’m fairly new to Tuist so apologies if this question has an obvious answer (I’ve tried to search for one, but no luck).
What I’d like to happen is, when a developer on our team runs tuist generate
on their machine, a script / some code is also kicked off that does a few things like:
- Copying across our pre-push hook to the
.git
directory (it exists by default in a more easy-to-find location within our repo) - Installing the latest version of SwiftLint that we’re currently supporting
Is there a best practice way to achieve this?
The approach I’m currently investigating appears to work thus far, but it doesn’t “feel” quite right (though this may be my lack of experience with Tuist).
I’ve basically changed our Workspace.swift
so, instead of:
let workspace = Workspace( ... )
It now reads:
let workspace = defaultWorkspace()
private func defaultWorkspace() -> Workspace {
// Run some native Swift code to copy across pre-push hook and do other stuff.
// Return original workspace here.
return Workspace( ... )
}
This appears to work so far (I’ve not got to the meat of it yet though) but I wanted to reach out to the community to understand whether I’ve approached this in an entirely unusual way .
I’m aware I could wrap tuist generate
in some other utility script and have developers use that to generate their project. I ideally don’t want to do this though because we’ve got a fairly large team and it would be a big muscle memory shift for something that gets run many times a day!
Thanks!