Some functions require changing the working directory. In older versions, we would use the Dir (working directory) field of exec.Command, but at some point it was changed to do os.Chdir() when needed.
This isn't a a problem when performing actions on the command line, since the runtime doesn't affect the working directory of the shell that called it. It does cause an issue when gin-cli functions are used by other projects, since they may call a function like CloneRepo() to clone a repository and on return the working directory of the calling program has changed.
This should be fixed for all functions that can be used externally, either by going back to setting the Dir of external commands and adjusting paths, or by deferring a os.Chdir() that restores the original working directory.
Some functions require changing the working directory. In older versions, we would use the
Dir
(working directory) field ofexec.Command
, but at some point it was changed to doos.Chdir()
when needed.This isn't a a problem when performing actions on the command line, since the runtime doesn't affect the working directory of the shell that called it. It does cause an issue when gin-cli functions are used by other projects, since they may call a function like
CloneRepo()
to clone a repository and on return the working directory of the calling program has changed.This should be fixed for all functions that can be used externally, either by going back to setting the
Dir
of external commands and adjusting paths, or by deferring aos.Chdir()
that restores the original working directory.