e28d95ce6f
Elimina operations.db de docker_tui (no lo usaba) y corrige pipeline_launcher para que resuelva operations.db en su propia carpeta (apps/pipeline_launcher/) en vez de la raíz del registro.
28 lines
634 B
Go
28 lines
634 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
)
|
|
|
|
// Config holds paths to databases.
|
|
type Config struct {
|
|
RegistryDB string // Path to registry.db
|
|
OperationsDB string // Path to operations.db
|
|
RegistryRoot string // Root directory of the registry (for resolving file paths)
|
|
}
|
|
|
|
// Default returns a Config resolved from environment or sensible defaults.
|
|
func Default() Config {
|
|
root := os.Getenv("FN_REGISTRY_ROOT")
|
|
if root == "" {
|
|
root = "."
|
|
}
|
|
|
|
return Config{
|
|
RegistryDB: filepath.Join(root, "registry.db"),
|
|
OperationsDB: filepath.Join(root, "apps", "pipeline_launcher", "operations.db"),
|
|
RegistryRoot: root,
|
|
}
|
|
}
|