Skip to content

Commit 08c724e

Browse files
authored
Merge pull request #21 from ultimateanu/ignore
Adding ignore flag.
2 parents 483516f + c03f9ca commit 08c724e

21 files changed

Lines changed: 844 additions & 238 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 6.0.x
18+
dotnet-version: 7.0.x
1919

2020
- name: Restore dependencies
2121
run: dotnet restore

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup .NET
1515
uses: actions/setup-dotnet@v1
1616
with:
17-
dotnet-version: 6.0.x
17+
dotnet-version: 7.0.x
1818

1919
- name: Restore dependencies
2020
run: dotnet restore

.github/workflows/nuget.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 6.0.x
18+
dotnet-version: 7.0.x
1919

2020
- name: Restore dependencies
2121
run: dotnet restore

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
1313
matrix:
14-
os: [ubuntu-latest, macos-11, windows-latest]
14+
os: [ubuntu-latest, macos-latest, windows-latest]
1515

1616
steps:
1717
- uses: actions/checkout@v2
1818

1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v1
2121
with:
22-
dotnet-version: 6.0.x
22+
dotnet-version: 7.0.x
2323

2424
- name: Build binaries
2525
run: dotnet fsi ./src/make_release.fsx build
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup .NET
4141
uses: actions/setup-dotnet@v1
4242
with:
43-
dotnet-version: 6.0.x
43+
dotnet-version: 7.0.x
4444

4545
- uses: actions/download-artifact@v2
4646
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET
1616
uses: actions/setup-dotnet@v1
1717
with:
18-
dotnet-version: 6.0.x
18+
dotnet-version: 7.0.x
1919

2020
- name: Restore dependencies
2121
run: dotnet restore

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
_A command-line utility to hash directories and files._
1010

11-
**hashdir** aims to be the easiest way to hash a file/directory. This is useful in many situations such as transferring files, archiving data, or detecting duplicates. It is a single binary, works on all major OS's, and has a simple command-line interface. It is developed with F# on .NET 6.
11+
**hashdir** aims to be the easiest way to hash a file/directory. This is useful in many situations such as transferring files, archiving data, or detecting duplicates. It is a single binary, works on all major OS's, and has a simple command-line interface. It is developed with F# on .NET 7.
1212

1313
Links: [Github](https://github.com/ultimateanu/hashdir), [NuGet](https://www.nuget.org/packages/hashdir), [Project Site](https://ultimateanu.github.io/hashdir)
1414

@@ -25,7 +25,7 @@ There are several ways to get hashdir. Full details can be found [here](https://
2525
## Usage
2626
```
2727
hashdir:
28-
A command-line utility to checksum directories and files.
28+
A command-line utility to hash directories and files.
2929
3030
Usage:
3131
hashdir [options] [<item>...] [command]
@@ -38,6 +38,7 @@ Options:
3838
-s, --save Save the checksum to a file
3939
-i, --include-hidden-files Include hidden files
4040
-e, --skip-empty-dir Skip empty directories
41+
-n, --ignore <pattern> Directories/files to not include
4142
-h, --hash-only Print only the hash
4243
-a, --algorithm <md5|ripemd160|sha1|sha256|sha384|sha512> The hash function to use [default: sha1]
4344
-c, --color Colorize the output [default: True]
@@ -52,6 +53,7 @@ Commands:
5253
1. Hash a file/directory: `hashdir ~/Desktop/project/`
5354
2. Hash a directory with hidden files and print tree: `hashdir --include-hidden-files --tree ~/Desktop/project`
5455
3. Hash multiple items using MD5: `hashdir -a md5 song.mp3 info.txt report.pdf`
56+
4. Hash a directory, but ignore certain directories/files: `hashdir --ignore "node_modules" --ignore "**/*.xml" ~/Desktop/project`
5557

5658
## License
5759
[MIT License](https://github.com/ultimateanu/hashdir/blob/main/LICENSE)

src/App.Tests/App.Tests.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
<GenerateProgramFile>false</GenerateProgramFile>

src/App.Tests/AppTests.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type AppTests(output: ITestOutputHelper) =
2222
true,
2323
true,
2424
false,
25+
[| "**/node"; "cache.txt" |], (* ignore *)
2526
false,
2627
"md5",
2728
false
@@ -30,7 +31,7 @@ type AppTests(output: ITestOutputHelper) =
3031
Assert.Equal(HashType.MD5, rootOpt.Algorithm)
3132

3233
let expectedStr =
33-
"RootOpt[Items:[|\"report.pdf\"; \"sources.txt\"|] PrintTree:true Save:true IncludeHiddenFiles:true SkipEmptyDir:false HashOnly:false Algorithm:MD5 Color:false]"
34+
"RootOpt[Items:[|\"report.pdf\"; \"sources.txt\"|] PrintTree:true Save:true IncludeHiddenFiles:true SkipEmptyDir:false IgnorePatterns:[|\"**/node\"; \"cache.txt\"|] HashOnly:false Algorithm:MD5 Color:false]"
3435

3536
Assert.Equal(expectedStr, rootOpt.ToString())
3637

@@ -41,6 +42,7 @@ type AppTests(output: ITestOutputHelper) =
4142
[| "report.pdf" |],
4243
false,
4344
true,
45+
[| "**/node"; "cache.txt" |], (* ignore *)
4446
"sha256",
4547
"detailed",
4648
true
@@ -51,7 +53,7 @@ type AppTests(output: ITestOutputHelper) =
5153
Assert.Equal(PrintVerbosity.Detailed, checkOpt.Verbosity)
5254

5355
let expectedStr =
54-
"CheckOpt[Items:[|\"report.pdf\"|] IncludeHiddenFiles:false SkipEmptyDir:true Algorithm:Some SHA256 Color:true]"
56+
"CheckOpt[Items:[|\"report.pdf\"|] IncludeHiddenFiles:false SkipEmptyDir:true IgnorePatterns:[|\"**/node\"; \"cache.txt\"|] Algorithm:Some SHA256 Color:true]"
5557

5658
Assert.Equal(expectedStr, checkOpt.ToString())
5759

@@ -62,6 +64,7 @@ type AppTests(output: ITestOutputHelper) =
6264
[| "report.pdf" |],
6365
false,
6466
true,
67+
[||], (* ignore *)
6568
null,
6669
"detailed",
6770
true

0 commit comments

Comments
 (0)