From 5ba9c8e9e287388f4c541196c9f3de428305d499 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Mon, 20 May 2024 14:25:17 +0200
Subject: [PATCH] fix: versioning

---
 flake.nix           |  7 ++++---
 project.nix         |  4 +---
 source/html/sync.go | 16 ++++++++++++++++
 3 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/flake.nix b/flake.nix
index 55eb6c2..87d8520 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 4a02ccc..6bd151d 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 f65c0d0..98046a7 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 {
-- 
GitLab