Open dvonessen opened 7 hours ago
Yea I dont think reclone will only respect certain envs it resets them before a new reclone.
I would recommend try using the --path
flag in your clone/reclone commands which will accomplish the same thing as setting the environment variable in combination with $(whoami) something like
ghorg clone NAME --scm=github --clone-type user --token xxxxxx --output-dir github.com/dvonessen --path /home/$(whoami)/git
I added --path /home/$(whoami)/git
but that leads into an exception.
panic: mkdir /home/$(whoami): operation not supported
goroutine 1 [running]:
github.com/gabrie30/ghorg/cmd.createDirIfNotExist()
/home/runner/work/ghorg/ghorg/cmd/clone.go:371 +0x88
github.com/gabrie30/ghorg/cmd.CloneAllRepos({0x10607d860, 0x1067735e0}, {0x140004d9108, 0x8, 0x8})
/home/runner/work/ghorg/ghorg/cmd/clone.go:649 +0x644
github.com/gabrie30/ghorg/cmd.setupRepoClone()
/home/runner/work/ghorg/ghorg/cmd/clone.go:335 +0x268
github.com/gabrie30/ghorg/cmd.cloneFunc(0x1066fc540, {0x14000466360, 0x1, 0x9})
/home/runner/work/ghorg/ghorg/cmd/clone.go:308 +0x12b4
github.com/spf13/cobra.(*Command).execute(0x1066fc540, {0x140004662d0, 0x9, 0x9})
/home/runner/work/ghorg/ghorg/vendor/github.com/spf13/cobra/command.go:989 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x1066fc260)
/home/runner/work/ghorg/ghorg/vendor/github.com/spf13/cobra/command.go:1117 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
/home/runner/work/ghorg/ghorg/vendor/github.com/spf13/cobra/command.go:1041
github.com/gabrie30/ghorg/cmd.Execute()
/home/runner/work/ghorg/ghorg/cmd/root.go:425 +0x24
main.main()
/home/runner/work/ghorg/ghorg/main.go:8 +0x1c
ERROR: Running ghorg clone cmd: ghorg clone yggdrasil3 --scm=gitlab --preserve-dir --token XXXXXXX --output-dir gitlab.com/yggdrasil3 --path /home/$(whoami)/test, err: exit status 2
I guess the exec.cmd
does not allow $()
subprocesses.
Describe the bug I'm running into an issue where ghorg reclone does not seem to respect the GHORG_ABSOLUTE_PATH_TO_CLONE_TO environment variable.
Context
Any advice or workaround would be appreciated! 😊
To Reproduce Steps to reproduce the behavior:
Configure
reclone.yaml
Full command and details of the clone (removing your token) e.g.
Details on the user/org you tried to clone e.g. is it your user, a public org, etc.
Environment (please complete the following information):
Additional context Add any other context about the problem here.