Skip to content

Commit

Permalink
version v0.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cuhsat committed Jun 8, 2024
1 parent 90c2ca1 commit 0413a96
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Instal packages
- name: Install packages
run: |
sudo apt update -y
sudo apt install -y qemu-utils
Expand Down
27 changes: 0 additions & 27 deletions internal/ffind/vsc.go

This file was deleted.

10 changes: 0 additions & 10 deletions internal/ffind/vsc_stub.go

This file was deleted.

35 changes: 4 additions & 31 deletions pkg/ffind/ffind.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import (
"encoding/csv"
"fmt"
"os"
"path/filepath"
"runtime"
"sync"
"time"

"github.com/cuhsat/fact/internal/fact"
"github.com/cuhsat/fact/internal/fact/hash"
"github.com/cuhsat/fact/internal/fact/zip"
vsc "github.com/cuhsat/fact/internal/ffind"
internal "github.com/cuhsat/fact/internal/ffind"

Check failure on line 15 in pkg/ffind/ffind.go

View workflow job for this annotation

GitHub Actions / build

no required module provides package github.com/cuhsat/fact/internal/ffind; to add it:
"github.com/cuhsat/fact/internal/sys"
"github.com/cuhsat/fact/pkg/windows"
)
Expand Down Expand Up @@ -112,7 +111,7 @@ func (ff *ffind) enum(out chan<- string) {
defer ff.wg.Done()

if ff.sc {
sc, err := vsc.ShadowCopy(windows.SystemDrive())
sc, err := internal.ShadowCopy(windows.SystemDrive())

if err != nil {
sys.Fatal(err)
Expand Down Expand Up @@ -179,14 +178,14 @@ func (ff *ffind) list(in <-chan string, out chan<- string) {

w := csv.NewWriter(f)

err = w.Write(header())
err = w.Write(internal.Header())

if err != nil {
sys.Fatal(err)
}

for artifact := range in {
err = w.Write(record(artifact))
err = w.Write(internal.Record(artifact))

if err != nil {
sys.Error(err)
Expand Down Expand Up @@ -241,29 +240,3 @@ func (ff *ffind) path(f string) string {

return f[r:]
}

func header() []string {
return []string{
"Filename",
"Path",
"Size (bytes)",
"Modified",
}
}

func record(f string) (l []string) {
l = append(l, filepath.Base(f))
l = append(l, f)

fi, err := os.Stat(f)

if err != nil {
sys.Error(err)
return
}

l = append(l, fmt.Sprintf("%d", fi.Size()))
l = append(l, fi.ModTime().String())

return
}

0 comments on commit 0413a96

Please sign in to comment.