- Resolved merge conflicts with latest dev branch. - Restored Medium abstraction in pkg/cli/daemon.go and context checks in pkg/container/linuxkit.go. - Refactored pkg/repos/registry.go to be truly medium-agnostic (removed filepath.Abs). - Updated pkg/cli/daemon_test.go to use MockMedium. - Verified all builds and tests pass locally.
44 lines
1.1 KiB
Go
44 lines
1.1 KiB
Go
package ci
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/host-uk/core/pkg/cli"
|
|
"github.com/host-uk/core/pkg/i18n"
|
|
"github.com/host-uk/core/pkg/io"
|
|
"github.com/host-uk/core/pkg/release"
|
|
)
|
|
|
|
func runCIReleaseInit() error {
|
|
cwd, err := os.Getwd()
|
|
if err != nil {
|
|
return cli.Err("%s: %w", i18n.T("i18n.fail.get", "working directory"), err)
|
|
}
|
|
|
|
cli.Print("%s %s\n\n", releaseDimStyle.Render(i18n.Label("init")), i18n.T("cmd.ci.init.initializing"))
|
|
|
|
// Check if already initialized
|
|
if release.ConfigExists(io.Local, cwd) {
|
|
cli.Text(i18n.T("cmd.ci.init.already_initialized"))
|
|
return nil
|
|
}
|
|
|
|
// Create release config
|
|
cfg := release.DefaultConfig()
|
|
if err := release.WriteConfig(io.Local, cfg, cwd); err != nil {
|
|
return cli.Err("%s: %w", i18n.T("i18n.fail.create", "config"), err)
|
|
}
|
|
|
|
cli.Blank()
|
|
cli.Print("%s %s\n", releaseSuccessStyle.Render("v"), i18n.T("cmd.ci.init.created_config"))
|
|
|
|
// Templates init removed as functionality not exposed
|
|
|
|
cli.Blank()
|
|
|
|
cli.Text(i18n.T("cmd.ci.init.next_steps"))
|
|
cli.Print(" %s\n", i18n.T("cmd.ci.init.edit_config"))
|
|
cli.Print(" %s\n", i18n.T("cmd.ci.init.run_ci"))
|
|
|
|
return nil
|
|
}
|