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
import (

View File

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

View File

@ -1,3 +1,5 @@
//go:build !yq_nolua
package yqlib
import (
@ -54,6 +56,7 @@ cities:
description: "Basic roundtrip",
skipDoc: true,
scenarioType: "roundtrip",
expression: `.cities[0] = "Adelaide"`,
input: `return {
["country"] = "Australia"; -- this place
["cities"] = {
@ -67,7 +70,7 @@ cities:
expected: `return {
["country"] = "Australia";
["cities"] = {
"Sydney",
"Adelaide",
"Melbourne",
"Brisbane",
"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
notoml
noxml
nolua
nullinput
onea
Oneshot

View File

@ -1,2 +1,2 @@
#!/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" .