Compare commits
No commits in common. "baa8e51b3e7b8f7c994b1ba579b91a8b01739006" and "1b0cd5728432bd55967f47326ce73c64e5cba7ba" have entirely different histories.
baa8e51b3e
...
1b0cd57284
6
Makefile
6
Makefile
@ -15,12 +15,6 @@ jx-cli:
|
|||||||
test: jx-cli
|
test: jx-cli
|
||||||
go test -coverprofile=artifacts/coverage.profile ./...
|
go test -coverprofile=artifacts/coverage.profile ./...
|
||||||
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
|
go tool cover -html=artifacts/coverage.profile -o artifacts/code-coverage.html
|
||||||
alpine-deps:
|
|
||||||
apk add make
|
|
||||||
apk add golangci-lint
|
|
||||||
apk add git
|
|
||||||
apk add luajit luajit-dev
|
|
||||||
apk add gpg gpg-agent
|
|
||||||
fedora-deps:
|
fedora-deps:
|
||||||
./jx apply build/rpm.jx.yaml
|
./jx apply build/rpm.jx.yaml
|
||||||
spectool -g -R build/jx.spec
|
spectool -g -R build/jx.spec
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
ErrConfigUndefinedName = errors.New("Config block is missing a defined name")
|
ErrConfigUndefinedName = errors.New("Config block is missing a defined name")
|
||||||
ErrConfigUndefined = errors.New("Config block is missing")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"embed"
|
"embed"
|
||||||
"compress/gzip"
|
"compress/gzip"
|
||||||
"path/filepath"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -100,6 +99,7 @@ type File struct {
|
|||||||
FileType FileType `json:"filetype" yaml:"filetype"`
|
FileType FileType `json:"filetype" yaml:"filetype"`
|
||||||
SerializeContent bool `json:"serializecontent,omitempty" yaml:"serializecontent,omitempty"`
|
SerializeContent bool `json:"serializecontent,omitempty" yaml:"serializecontent,omitempty"`
|
||||||
GzipContent bool `json:"gzipcontent,omitempty" yaml:"gzipcontent,omitempty"`
|
GzipContent bool `json:"gzipcontent,omitempty" yaml:"gzipcontent,omitempty"`
|
||||||
|
Resources data.ResourceMapper `json:"-" yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResourceFileInfo struct {
|
type ResourceFileInfo struct {
|
||||||
@ -135,6 +135,10 @@ func (f *File) Init(u data.URIParser) error {
|
|||||||
return f.SetParsedURI(u)
|
return f.SetParsedURI(u)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *File) NormalizePath() error {
|
||||||
|
return f.Common.NormalizePath()
|
||||||
|
}
|
||||||
|
|
||||||
func (f *File) ContentType() string {
|
func (f *File) ContentType() string {
|
||||||
var ext strings.Builder
|
var ext strings.Builder
|
||||||
if f.parsedURI.Scheme != "file" {
|
if f.parsedURI.Scheme != "file" {
|
||||||
@ -149,6 +153,10 @@ func (f *File) ContentType() string {
|
|||||||
return ext.String()
|
return ext.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (f *File) SetResourceMapper(resources data.ResourceMapper) {
|
||||||
|
f.Resources = resources
|
||||||
|
}
|
||||||
|
|
||||||
func (f *File) Clone() data.Resource {
|
func (f *File) Clone() data.Resource {
|
||||||
return &File {
|
return &File {
|
||||||
Common: f.Common.Clone(),
|
Common: f.Common.Clone(),
|
||||||
@ -364,15 +372,6 @@ func (f *File) ResolveId(ctx context.Context) string {
|
|||||||
return f.Common.Path
|
return f.Common.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *File) NormalizePath() error {
|
|
||||||
if f.config != nil {
|
|
||||||
if prefixPath, configErr := f.config.GetValue("prefix"); configErr == nil {
|
|
||||||
f.Common.Path = filepath.Join(prefixPath.(string), f.Common.Path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return f.Common.NormalizePath()
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
func (f *File) NormalizePath() (err error) {
|
func (f *File) NormalizePath() (err error) {
|
||||||
if f.config != nil {
|
if f.config != nil {
|
||||||
@ -596,11 +595,11 @@ func (f *File) ContentSourceRefStat() (info fs.FileInfo) {
|
|||||||
|
|
||||||
func (f *File) ReadStat() (err error) {
|
func (f *File) ReadStat() (err error) {
|
||||||
var info fs.FileInfo
|
var info fs.FileInfo
|
||||||
slog.Info("File.ReadStat()", "filesystem", f.Filesystem, "path", f.Common.Path)
|
slog.Info("ReadStat()", "filesystem", f.Filesystem, "path", f.Common.Path)
|
||||||
|
|
||||||
info, err = f.Stat()
|
info, err = f.Stat()
|
||||||
|
|
||||||
slog.Info("File.ReadStat()", "filesystem", f.Filesystem, "path", f.Common.Path, "info", info, "error", err)
|
slog.Info("ReadStat()", "filesystem", f.Filesystem, "path", f.Common.Path, "info", info, "error", err)
|
||||||
|
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_ = f.SetFileInfo(info)
|
_ = f.SetFileInfo(info)
|
||||||
@ -614,7 +613,7 @@ func (f *File) ReadStat() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
slog.Info("File.ReadStat()", "stat", info, "path", f.Common.Path)
|
slog.Info("ReadStat()", "stat", info, "path", f.Common.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
f.Common.State = "absent"
|
f.Common.State = "absent"
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user