diff --git a/flake.nix b/flake.nix index 55eb6c2f3be7aa54a44b9c948f6056058fe9f090..87d8520a60d206dea728443a5f9b2ee2e8d4adea 100644 --- a/flake.nix +++ b/flake.nix @@ -3,10 +3,11 @@ # Nixpkgs / NixOS version to use. inputs.nixpkgs.url = "nixpkgs/nixos-23.11"; - + outputs = { self, nixpkgs, + ... }: let # to work with older version of flakes lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101"; @@ -47,8 +48,8 @@ ldflags = [ "-X 'gitlab.schukai.com/oss/bob/release.version=${goPkgVersion}'" - "-X 'gitlab.schukai.com/oss/bob/release.commit=${goPkgHash}'" - "-X 'gitlab.schukai.com/oss/bob/release.buildDate=${lastModifiedDate}'" + "-X 'gitlab.schukai.com/oss/bob/release.commit=${self.rev or "unknown"}'" + "-X 'gitlab.schukai.com/oss/bob/release.buildDate=${self.lastModifiedDate or "unknown"}'" "-X 'gitlab.schukai.com/oss/bob/release.name=${goPkgName}'" "-X 'gitlab.schukai.com/oss/bob/release.mnemonic=${goPkgMnemonic}'" ]; diff --git a/project.nix b/project.nix index 4a02ccc2ca5daf191976a0919b0813eb3693c40c..6bd151d271721c876d54a25613b7d35875046302 100644 --- a/project.nix +++ b/project.nix @@ -5,7 +5,5 @@ supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]; compileForSystems = ["linux/arm64" "linux/amd64" "darwin/amd64" "windows/amd64"]; modulePath = "gitlab.schukai.com/oss/bob"; - version = "0.5.0"; ## do not change this line; it will be updated automatically - vendorHash = null; ## do not change this line; it will be updated automatically - commitHash = "0747ca6"; ## do not change this line; it will be updated automatically + version = "0.5.5"; ## do not change this line; it will be updated automatically } diff --git a/source/html/sync.go b/source/html/sync.go index f65c0d0d863b8734bb5b809da16777a5e4a4c0ee..98046a792a98f9c5b220f963fd997aa86dfd4983 100644 --- a/source/html/sync.go +++ b/source/html/sync.go @@ -9,6 +9,7 @@ import ( "gopkg.in/yaml.v3" "os" "path/filepath" + "strings" ) type Specification struct { @@ -255,10 +256,25 @@ func checkExcludes(exclude []string, d string) (bool, error) { return false, err } + if e == "" { + continue + } + if e == d { return true, nil } + fileInfo, err := os.Stat(e) + if err != nil { + return false, err + } + + if fileInfo.IsDir() { + if strings.HasPrefix(d, e) { + return true, nil + } + } + if r, err := filepath.Match(e, d); err != nil { return false, err } else if r {