MCPcopy
hub / github.com/bitfield/script / ExamplePipe_JQ

Function ExamplePipe_JQ

script_test.go:2465–2472  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2463}
2464
2465func ExamplePipe_JQ() {
2466 kernel := "Darwin"
2467 arch := "x86_64"
2468 query := fmt.Sprintf(".assets[] | select(.name | endswith(\"%s_%s.tar.gz\")).browser_download_url", kernel, arch)
2469 script.File("testdata/releases.json").JQ(query).Stdout()
2470 // Output:
2471 // "https://github.com/mbarley333/blackjack/releases/download/v0.3.3/blackjack_0.3.3_Darwin_x86_64.tar.gz"
2472}
2473
2474func ExamplePipe_Last() {
2475 script.Echo("a\nb\nc\n").Last(2).Stdout()

Callers

nothing calls this directly

Calls 3

FileFunction · 0.92
StdoutMethod · 0.80
JQMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…