mirror of
https://github.com/cline/cline.git
synced 2025-06-03 03:59:07 +00:00
Fix build-protos script on windows (#3670)
This commit is contained in:
parent
c7c1d37379
commit
aff78bda7c
@ -10,12 +10,16 @@ import chalk from "chalk"
|
|||||||
import { createRequire } from "module"
|
import { createRequire } from "module"
|
||||||
const require = createRequire(import.meta.url)
|
const require = createRequire(import.meta.url)
|
||||||
const protoc = path.join(require.resolve("grpc-tools"), "../bin/protoc")
|
const protoc = path.join(require.resolve("grpc-tools"), "../bin/protoc")
|
||||||
const tsProtoPlugin = require.resolve("ts-proto/protoc-gen-ts_proto")
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
const SCRIPT_DIR = path.dirname(__filename)
|
const SCRIPT_DIR = path.dirname(__filename)
|
||||||
const ROOT_DIR = path.resolve(SCRIPT_DIR, "..")
|
const ROOT_DIR = path.resolve(SCRIPT_DIR, "..")
|
||||||
|
|
||||||
|
const isWindows = process.platform === "win32"
|
||||||
|
const tsProtoPlugin = isWindows
|
||||||
|
? path.join(ROOT_DIR, "node_modules", ".bin", "protoc-gen-ts_proto.cmd") // Use the .bin directory path for Windows
|
||||||
|
: require.resolve("ts-proto/protoc-gen-ts_proto")
|
||||||
|
|
||||||
// List of gRPC services
|
// List of gRPC services
|
||||||
// To add a new service, simply add it to this map and run this script
|
// To add a new service, simply add it to this map and run this script
|
||||||
// The service handler will be automatically discovered and used by grpc-handler.ts
|
// The service handler will be automatically discovered and used by grpc-handler.ts
|
||||||
@ -56,7 +60,7 @@ async function main() {
|
|||||||
|
|
||||||
// Process all proto files
|
// Process all proto files
|
||||||
console.log(chalk.cyan("Processing proto files from"), SCRIPT_DIR)
|
console.log(chalk.cyan("Processing proto files from"), SCRIPT_DIR)
|
||||||
const protoFiles = await globby("*.proto", { cwd: SCRIPT_DIR, absolute: true })
|
const protoFiles = await globby("*.proto", { cwd: SCRIPT_DIR, realpath: true })
|
||||||
|
|
||||||
// Build the protoc command with proper path handling for cross-platform
|
// Build the protoc command with proper path handling for cross-platform
|
||||||
const tsProtocCommand = [
|
const tsProtocCommand = [
|
||||||
|
Loading…
Reference in New Issue
Block a user