chore: remove invoke-binary.js and update main.go logic
All checks were successful
Lint Pull Request / Lint Pr Title (pull_request) Successful in 9s
All checks were successful
Lint Pull Request / Lint Pr Title (pull_request) Successful in 9s
This commit is contained in:
parent
6d9c48078c
commit
80ab70da04
2 changed files with 7 additions and 32 deletions
|
@ -1,30 +0,0 @@
|
|||
const childProcess = require('child_process')
|
||||
const path = require('path')
|
||||
|
||||
function runGo() {
|
||||
const goProcess = childProcess.spawnSync(
|
||||
'go',
|
||||
['run', '.'],
|
||||
{
|
||||
cwd: __dirname,
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
},
|
||||
)
|
||||
|
||||
if (goProcess.error) {
|
||||
console.error('Failed to execute `go run .`:', goProcess.error)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
if (goProcess.status !== 0) {
|
||||
console.error(
|
||||
'`go run .` exited with code',
|
||||
goProcess.status,
|
||||
goProcess.stderr ? goProcess.stderr.toString() : '',
|
||||
)
|
||||
process.exit(goProcess.status)
|
||||
}
|
||||
}
|
||||
|
||||
runGo()
|
9
main.go
9
main.go
|
@ -6,6 +6,11 @@ import (
|
|||
)
|
||||
|
||||
func main() {
|
||||
prTitle := os.Getenv("GITEA_PULL_REQUEST_TITLE")
|
||||
fmt.Println(prTitle)
|
||||
// Get all environment variables
|
||||
environ := os.Environ()
|
||||
|
||||
// Print each environment variable
|
||||
for _, env := range environ {
|
||||
fmt.Println(env)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue