Worker: fix "failed to retrieve Orchard's home directory path" (#309)

When running through launchd and no HOME is set.
This commit is contained in:
Nikolay Edigaryev
2025-04-17 21:57:04 +04:00
committed by GitHub
parent 0a3d9c6d1c
commit 40f222c408
3 changed files with 13 additions and 23 deletions
-13
View File
@@ -3,14 +3,9 @@
package worker
import (
"github.com/cirruslabs/orchard/internal/orchardhome"
"github.com/spf13/cobra"
"log"
"path/filepath"
)
var dataDirPath string
func NewCommand() *cobra.Command {
command := &cobra.Command{
Use: "worker",
@@ -19,13 +14,5 @@ func NewCommand() *cobra.Command {
command.AddCommand(newRunCommand())
orchardHome, err := orchardhome.Path()
if err != nil {
log.Fatal(err)
}
command.PersistentFlags().StringVar(&dataDirPath, "data-dir", filepath.Join(orchardHome, "worker"),
"path to the worker's data directory")
return command
}