You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
success(fmt.Sprintf("Runtime binaries already installed in %s", binDir))
83
90
return
84
91
}
85
92
86
-
if_, err:=exec.LookPath("go"); err!=nil {
87
-
fail("Go toolchain is required to build RagCode binaries. Install Go from https://go.dev/doc/install or rerun without --skip-build once binaries exist.")
88
-
}
93
+
log(fmt.Sprintf("Installing runtime binaries into %s...", binDir))
94
+
for_, bin:=rangemissingBinaries {
95
+
binName:=bin.name
96
+
ifruntime.GOOS=="windows" {
97
+
binName+=".exe"
98
+
}
99
+
output:=filepath.Join(binDir, binName)
89
100
90
-
log(fmt.Sprintf("Building RagCode binaries into %s...", binDir))
fail(fmt.Sprintf("Failed to build %s: %v", bin.name, err))
99
-
}
100
-
iferr:=os.Chmod(output, 0755); err!=nil {
101
-
fail(fmt.Sprintf("Failed to set executable bit on %s: %v", output, err))
102
-
}
103
-
success(fmt.Sprintf("Installed %s", output))
101
+
// Option 1: Check if pre-built binary exists in current directory (from release archive)
102
+
if_, err:=os.Stat(binName); err==nil {
103
+
log(fmt.Sprintf(" - Found %s in current directory, copying...", binName))
104
+
iferr:=copyFile(binName, output); err!=nil {
105
+
fail(fmt.Sprintf("Failed to copy %s: %v", binName, err))
106
+
}
107
+
iferr:=os.Chmod(output, 0755); err!=nil {
108
+
warn(fmt.Sprintf("Could not set executable flag on %s: %v", binName, err))
109
+
}
110
+
success(fmt.Sprintf("Installed %s", output))
111
+
continue
112
+
}
113
+
114
+
// Option 2: Fallback to building from source if Go is available and source exists
115
+
if_, err:=os.Stat(bin.pkg); err==nil {
116
+
if_, err:=exec.LookPath("go"); err!=nil {
117
+
fail(fmt.Sprintf("Binary %s not found and Go toolchain is not available. Please download the complete release archive from:\nhttps://github.com/doITmagic/rag-code-mcp/releases/latest", binName))
118
+
}
119
+
log(fmt.Sprintf(" - Building %s from source...", bin.name))
fail(fmt.Sprintf("Failed to build %s: %v", bin.name, err))
125
+
}
126
+
iferr:=os.Chmod(output, 0755); err!=nil {
127
+
fail(fmt.Sprintf("Failed to set executable bit on %s: %v", output, err))
128
+
}
129
+
success(fmt.Sprintf("Built and installed %s", output))
130
+
continue
131
+
}
132
+
133
+
// Neither pre-built binary nor source found
134
+
fail(fmt.Sprintf("Binary %s not found in current directory and source not available. Please download the complete release archive from:\nhttps://github.com/doITmagic/rag-code-mcp/releases/latest", binName))
0 commit comments