Closed rafecolton closed 10 years ago
In fact, since this is going to be used in a multi-threaded application, we probably shouldn't be using $PWD
anywhere in the code
I say go full paranoid mode. Chdir to a known, controlled location every time a location-sensitive operation needs to happen. Is that what you meant by avoiding $PWD?
@meatballhat not quite, but along those same lines, yes. I mean taking it one step further and not relying on $PWD
for anything. Instead, I intend to make all location-sensitive operations relative to either the builder's workdir or relative to the Bobfile
for a given repo. I guess using $PWD
in this context feels a little like using a singleton in an environment in which there should be multiple instances.
Turns out this was simpler than I anticipated: https://github.com/modcloth/docker-builder/pull/39
If we try to run builder from somewhere else, bad things happen:
parser/tag/tag.go
What should we do instead? Since we're shelling out to
git
, we should probably use theBobfile
's directory as top instead of$PWD