Can build yq with no lua

This commit is contained in:
Mike Farah 2023-10-03 16:22:23 +11:00
parent 5fa41624c9
commit 6e65d44a98
7 changed files with 30 additions and 2 deletions

9
examples/data.lua Normal file
View File

@ -0,0 +1,9 @@
return {
["country"] = "Australia"; -- this place
["cities"] = {
"Sydney",
"Melbourne",
"Brisbane",
"Perth",
};
};

View File

@ -1,3 +1,5 @@
//go:build !yq_nolua
package yqlib package yqlib
import ( import (

View File

@ -1,3 +1,5 @@
//go:build !yq_nolua
package yqlib package yqlib
import ( import (

View File

@ -1,3 +1,5 @@
//go:build !yq_nolua
package yqlib package yqlib
import ( import (
@ -54,6 +56,7 @@ cities:
description: "Basic roundtrip", description: "Basic roundtrip",
skipDoc: true, skipDoc: true,
scenarioType: "roundtrip", scenarioType: "roundtrip",
expression: `.cities[0] = "Adelaide"`,
input: `return { input: `return {
["country"] = "Australia"; -- this place ["country"] = "Australia"; -- this place
["cities"] = { ["cities"] = {
@ -67,7 +70,7 @@ cities:
expected: `return { expected: `return {
["country"] = "Australia"; ["country"] = "Australia";
["cities"] = { ["cities"] = {
"Sydney", "Adelaide",
"Melbourne", "Melbourne",
"Brisbane", "Brisbane",
"Perth", "Perth",

11
pkg/yqlib/no_lua.go Normal file
View File

@ -0,0 +1,11 @@
//go:build yq_nolua
package yqlib
func NewLuaEncoder(prefs LuaPreferences) Encoder {
return nil
}
func NewLuaDecoder(prefs LuaPreferences) Decoder {
return nil
}

View File

@ -155,6 +155,7 @@ Nonquoting
nosec nosec
notoml notoml
noxml noxml
nolua
nullinput nullinput
onea onea
Oneshot Oneshot

View File

@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
go build -tags yq_notoml -tags yq_noxml -tags yq_nojson -ldflags "-s -w" . go build -tags "yq_nolua yq_notoml yq_noxml yq_nojson" -ldflags "-s -w" .