refactor: move all remaining files to orig/ directory
Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
82
orig/tools/main.go
Normal file
82
orig/tools/main.go
Normal file
@@ -0,0 +1,82 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/fraktal/mev-beta/tools/bridge"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// define subcommands
|
||||
applyCmd := flag.NewFlagSet("apply", flag.ExitOnError)
|
||||
revertCmd := flag.NewFlagSet("revert", flag.ExitOnError)
|
||||
runCmd := flag.NewFlagSet("run", flag.ExitOnError)
|
||||
summarizeCmd := flag.NewFlagSet("summarize", flag.ExitOnError)
|
||||
|
||||
// apply flags
|
||||
applyPatch := applyCmd.String("patch", "", "Path to patch file")
|
||||
applyBranch := applyCmd.String("branch", "", "Branch name to apply patch")
|
||||
|
||||
// revert flags
|
||||
revertBranchName := revertCmd.String("branch", "", "Branch name to revert")
|
||||
|
||||
// run flags
|
||||
runMode := runCmd.String("mode", "", "Execution mode (podman-compose)")
|
||||
|
||||
// summarize flags
|
||||
summarizeArtifacts := summarizeCmd.String("artifacts", "", "Path to artifacts directory")
|
||||
summarizeOut := summarizeCmd.String("out", "", "Output JSON file path")
|
||||
|
||||
// parse subcommand
|
||||
if len(os.Args) < 2 {
|
||||
log.Fatal("subcommand required: apply, revert, run, summarize")
|
||||
}
|
||||
|
||||
switch os.Args[1] {
|
||||
case "apply":
|
||||
applyCmd.Parse(os.Args[2:])
|
||||
if *applyPatch == "" || *applyBranch == "" {
|
||||
log.Fatal("--patch and --branch are required")
|
||||
}
|
||||
op := bridge.PatchOperation{
|
||||
PatchFile: *applyPatch,
|
||||
BranchName: *applyBranch,
|
||||
}
|
||||
if err := bridge.ApplyPatch(op); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
case "revert":
|
||||
revertCmd.Parse(os.Args[2:])
|
||||
if *revertBranchName == "" {
|
||||
log.Fatal("--branch is required")
|
||||
}
|
||||
if err := bridge.RevertBranch(*revertBranchName); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
case "run":
|
||||
runCmd.Parse(os.Args[2:])
|
||||
if *runMode == "podman-compose" {
|
||||
if err := bridge.RunPodmanCompose(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
} else {
|
||||
log.Fatalf("unsupported run mode: %s", *runMode)
|
||||
}
|
||||
case "summarize":
|
||||
summarizeCmd.Parse(os.Args[2:])
|
||||
if *summarizeArtifacts == "" || *summarizeOut == "" {
|
||||
log.Fatal("--artifacts and --out are required")
|
||||
}
|
||||
cfg := bridge.SummarizeConfig{
|
||||
ArtifactsDir: *summarizeArtifacts,
|
||||
OutputFile: *summarizeOut,
|
||||
}
|
||||
if err := bridge.SummarizeArtifacts(cfg); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
default:
|
||||
log.Fatalf("unknown subcommand: %s", os.Args[1])
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user