@@ -10,8 +10,9 @@ const fingerprintShortDesc = `Calculate the SHA256 fingerprint of an artifact.`
1010
1111const fingerprintDirSynopsis = `When fingerprinting a 'dir' artifact, you can exclude certain paths from fingerprint calculation
1212using the ^--exclude^ flag.
13- Excluded paths are relative to the DIR-PATH and can be literal paths or
14- glob patterns.
13+ Excluded paths are relative to the DIR-PATH and can be literal paths or glob patterns.
14+ With a directory structure like this ^foo/bar/zam/file.txt^ if you are calculating the fingerprint of ^foo/bar^ you need to
15+ exclude ^zam/file.txt^ which is relative to the DIR-PATH.
1516The supported glob pattern syntax is what is documented here: https://pkg.go.dev/path/filepath#Match ,
1617plus the ability to use recursive globs "**"
1718
@@ -34,9 +35,16 @@ kosli fingerprint --artifact-type file file.txt
3435# fingerprint a dir
3536kosli fingerprint --artifact-type dir mydir
3637
37- # fingerprint a dir while excluding paths
38+ # fingerprint a dir while excluding paths ^mydir/logs^ and ^mydir/*exe^
3839kosli fingerprint --artifact-type dir --exclude logs --exclude *.exe mydir
3940
41+ # fingerprint a dir while excluding all ^.pyc^ files
42+ kosli fingerprint --artifact-type dir --exclude **/*.pyc mydir
43+
44+ # fingerprint a dir while excluding paths in .kosli_ignore file
45+ echo bar/file.txt > mydir/.kosli_ignore
46+ kosli fingerprint --artifact-type dir mydir
47+
4048# fingerprint a locally available docker image (requires docker daemon running)
4149kosli fingerprint --artifact-type docker nginx:latest
4250
0 commit comments