Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding FIREFLY_HOME env variable (optional) #257

Merged
merged 4 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ would otherwise be a time consuming manual task. It also wraps docker compose
commands to manage the lifecycle of stacks.

To get started run: ff init
Optional: Set FIREFLY_HOME env variable for FireFly stack configuration path.
`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
if ansi == "always" {
Expand Down
12 changes: 9 additions & 3 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ import (
"path/filepath"
)

var homeDir, _ = os.UserHomeDir()
var StacksDir = filepath.Join(homeDir, ".firefly", "stacks")

var StacksDir = checkHome()
var FireFlyCoreImageName = "ghcr.io/hyperledger/firefly"
var IPFSImageName = "ipfs/go-ipfs:v0.10.0"
var PostgresImageName = "postgres"
var PrometheusImageName = "prom/prometheus"
var SandboxImageName = "ghcr.io/hyperledger/firefly-sandbox:latest"

func checkHome() string {
var homeDir, _ = os.UserHomeDir()
var StacksDir = filepath.Join(homeDir, ".firefly", "stacks")
var fireflyhome, present = os.LookupEnv("FIREFLY_HOME")
if present { StacksDir = filepath.Join(fireflyhome, "stacks") }
return StacksDir
}
Loading