agent icon indicating copy to clipboard operation
agent copied to clipboard

Split bootstrap

Open moskyb opened this issue 3 years ago • 2 comments

the bootstrap.go file is currently about 4k lines long, and is basically impossible to navigate with anything other than ctrl-f and judicious use of go to definition.

This PR splits the bootstrap file up into 6(!) files - one for the main bootstrap process, still called bootstrap.go, and one each for:

  • Checkout-related stuff (checkout.go)
  • Artifacts (artifacts.go)
  • Plugin handling (plugin.go)
  • Command running (command.go)
  • Hook handling (hook.go)

It also does a minor clean up in the *Bootstrap.Run() function

moskyb avatar Jul 18 '22 22:07 moskyb

Another approach to this might be to actually split out the phases as different structs in different files. 🤔

lox avatar Jul 28 '22 01:07 lox

@lox yeah, i agree, but that's a lot more difficult than just splitting up a file and calling it a day 😅

i'd love to have more functional separation between bootstrap phases as well as having them just live in different files, but i think it achieves a different thing that this PR does, which is just make the bootstrap process more navigable from a "having files open in your editor" standpoint

moskyb avatar Jul 28 '22 03:07 moskyb