fixed the return values to strings instead of JSON.parse
This commit is contained in:
@@ -15,7 +15,7 @@ export const prList = tool({
|
||||
: $`tea pr list --output json --state ${args.state} --limit ${args.limit}`
|
||||
|
||||
const result = await cmd.text()
|
||||
return JSON.parse(result)
|
||||
return result
|
||||
} catch (error: any) {
|
||||
return {
|
||||
error: "Failed to list pull requests",
|
||||
@@ -53,7 +53,7 @@ export const prCreate = tool({
|
||||
}
|
||||
|
||||
const result = await cmd.text()
|
||||
return JSON.parse(result)
|
||||
return result
|
||||
} catch (error: any) {
|
||||
return {
|
||||
error: "Failed to create pull request",
|
||||
@@ -106,7 +106,7 @@ export const prMerge = tool({
|
||||
}
|
||||
|
||||
const result = await cmd.text()
|
||||
return JSON.parse(result)
|
||||
return result
|
||||
} catch (error: any) {
|
||||
return {
|
||||
error: "Failed to merge pull request",
|
||||
@@ -125,7 +125,7 @@ export const prDetails = tool({
|
||||
async execute(args, context) {
|
||||
try {
|
||||
const result = await $`tea pr ${args.prNumber} --output json --comments`.text()
|
||||
return JSON.parse(result)
|
||||
return result
|
||||
} catch (error: any) {
|
||||
return {
|
||||
error: "Failed to get pull request details",
|
||||
|
||||
Reference in New Issue
Block a user