Skip to content

Commit 2001499

Browse files
committed
Updating readme
Signed-off-by: Raj Babu Das <mail.rajdas@gmail.com>
1 parent bb981fd commit 2001499

File tree

5 files changed

+61
-9
lines changed

5 files changed

+61
-9
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
2-
main
2+
main
3+
scripts

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Diffr - Compare Directory Content Differences with Ease
1+
# Diffr - Simplifying Directory and File Content Comparison
22

33

4-
Diffr is an open-source web-based tool designed to make comparing content differences between two directories a simple and intuitive process. Whether you're a developer comparing source code, a designer comparing image assets, or anyone dealing with files, Diffr provides a user-friendly interface to quickly identify changes and similarities between directories.
4+
Diffr is an open-source web-based tool designed to make comparing content differences between two directories, and even files, a simple and intuitive process. Whether you're a developer comparing source code, a designer comparing image assets, or anyone dealing with files, Diffr provides a user-friendly interface to quickly identify changes and similarities between directories and files.
55

66
Visit the project on GitHub: [https://github.com/imrajdas/diffr](https://github.com/imrajdas/diffr)
77

@@ -27,10 +27,10 @@ go get -u github.com/imrajdas/diffr
2727

2828
## Usage
2929

30-
Diffr simplifies the process of comparing content differences between two directories. The basic usage is as follows:
30+
Diffr simplifies the process of comparing content differences between two directories or files. The basic usage is as follows:
3131

3232
```bash
33-
diffr [dir1] [dir2] [flags]
33+
diffr [dir1/file1] [dir2/file2] [flags]
3434
```
3535

3636
You can also use the command to access specific features:
@@ -52,7 +52,7 @@ Diffr provides the following flags to customize its behavior:
5252

5353
- `-a, --address string`: Set the address for the web server to listen on. The default is `http://localhost`.
5454
- `-h, --help`: Display help information about Diffr.
55-
- `-p, --port int`: Set the port for the web server to listen on. The default is `8080`.
55+
- `-p, --port int`: Set the port for the web server to listen on. The default is `8675`.
5656

5757
## Examples
5858

@@ -62,6 +62,9 @@ Here are some examples of how to use Diffr:
6262
# Compare contents of two directories
6363
diffr /path/to/dir1 /path/to/dir2
6464

65+
# Compare contents of two files
66+
diffr /path/to/file1 /path/to/file2
67+
6568
# Compare contents with custom server address and port
6669
diffr /path/to/dir1 /path/to/dir2 -a http://127.0.0.1 -p 9000
6770
```
@@ -76,4 +79,4 @@ Diffr is released under the [Apache](LICENSE). You are free to use, modify, and
7679

7780
---
7881

79-
Diffr makes directory content comparison hassle-free, allowing you to focus on identifying differences rather than dealing with complex tools. Give it a try, and make directory comparison a breeze!
82+
Diffr makes directory and file content comparison hassle-free, allowing you to focus on identifying differences rather than dealing with complex tools. Give it a try, and make directory and file comparison a breeze!

pkg/cmd/root/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import (
77
)
88

99
var rootCmd = &cobra.Command{
10-
Use: "diffr [dir1] [dir2]",
10+
Use: "diffr [dir1/file1] [dir2/file2]",
1111
Example: "diffr /path/to/dir1 /path/to/dir2",
1212
Short: "A web-based content difference analyzer",
13-
Long: `A web-based tool to compare content differences between two directories ` + "\n" + `Find more information at: https://github.com/imrajdas/diffr`,
13+
Long: `A web-based tool to compare content differences between two directories/files` + "\n" + `Find more information at: https://github.com/imrajdas/diffr`,
1414
Args: cobra.ExactArgs(2),
1515
Run: diffr.RunWebServer,
1616
}

scripts/build.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
3+
custom_package="diffr"
4+
if [[ -z "$custom_package" ]]; then
5+
echo "Usage: $0 diffr [dir1/file1 dir2/file2]]"
6+
exit 1
7+
fi
8+
9+
custom_tag="0.1.0"
10+
11+
custom_platforms=(
12+
"darwin/amd64"
13+
"linux/386"
14+
"linux/amd64"
15+
"linux/arm"
16+
"linux/arm64"
17+
"windows/386"
18+
"windows/amd64"
19+
"windows/arm"
20+
)
21+
22+
rm -rf custom-platforms-$custom_tag/*
23+
for custom_platform in "${custom_platforms[@]}"
24+
do
25+
platform_split=(${custom_platform//\// })
26+
CUSTOM_GOOS=${platform_split[0]}
27+
CUSTOM_GOARCH=${platform_split[1]}
28+
echo 'Building' $CUSTOM_GOOS-$CUSTOM_GOARCH
29+
custom_output_name=$custom_package'-'$CUSTOM_GOOS-$CUSTOM_GOARCH
30+
31+
env GOOS=$CUSTOM_GOOS GOARCH=$CUSTOM_GOARCH VERSION=$custom_tag go build -ldflags "-X main.Version=$custom_tag" -v -o custom-platforms-$custom_tag/$custom_output_name $custom_package
32+
33+
if [ $? -ne 0 ]; then
34+
echo 'An error occurred! Aborting the script execution...'
35+
exit 1
36+
fi
37+
38+
custom_bin_name=$custom_package
39+
if [ "$CUSTOM_GOOS" == 'windows' ]; then
40+
custom_bin_name=$custom_package'.exe'
41+
fi
42+
43+
cd custom-platforms-$custom_tag
44+
mv $custom_output_name $custom_bin_name
45+
tar -czvf $custom_output_name-$custom_tag.tar.gz $custom_bin_name
46+
rm -rf $custom_bin_name
47+
cd ..
48+
done

static/images/demo.png

346 Bytes
Loading

0 commit comments

Comments
 (0)