Skip to content

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
Signed-off-by: Raj Babu Das <[email protected]>
  • Loading branch information
imrajdas committed Aug 26, 2023
1 parent bb981fd commit 2001499
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
main
main
scripts
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Diffr - Compare Directory Content Differences with Ease
# Diffr - Simplifying Directory and File Content Comparison


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.
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.

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

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

## Usage

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

```bash
diffr [dir1] [dir2] [flags]
diffr [dir1/file1] [dir2/file2] [flags]
```

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

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

## Examples

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

# Compare contents of two files
diffr /path/to/file1 /path/to/file2

# Compare contents with custom server address and port
diffr /path/to/dir1 /path/to/dir2 -a http://127.0.0.1 -p 9000
```
Expand All @@ -76,4 +79,4 @@ Diffr is released under the [Apache](LICENSE). You are free to use, modify, and

---

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!
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!
4 changes: 2 additions & 2 deletions pkg/cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
)

var rootCmd = &cobra.Command{
Use: "diffr [dir1] [dir2]",
Use: "diffr [dir1/file1] [dir2/file2]",
Example: "diffr /path/to/dir1 /path/to/dir2",
Short: "A web-based content difference analyzer",
Long: `A web-based tool to compare content differences between two directories ` + "\n" + `Find more information at: https://github.com/imrajdas/diffr`,
Long: `A web-based tool to compare content differences between two directories/files` + "\n" + `Find more information at: https://github.com/imrajdas/diffr`,
Args: cobra.ExactArgs(2),
Run: diffr.RunWebServer,
}
Expand Down
48 changes: 48 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash

custom_package="diffr"
if [[ -z "$custom_package" ]]; then
echo "Usage: $0 diffr [dir1/file1 dir2/file2]]"
exit 1
fi

custom_tag="0.1.0"

custom_platforms=(
"darwin/amd64"
"linux/386"
"linux/amd64"
"linux/arm"
"linux/arm64"
"windows/386"
"windows/amd64"
"windows/arm"
)

rm -rf custom-platforms-$custom_tag/*
for custom_platform in "${custom_platforms[@]}"
do
platform_split=(${custom_platform//\// })
CUSTOM_GOOS=${platform_split[0]}
CUSTOM_GOARCH=${platform_split[1]}
echo 'Building' $CUSTOM_GOOS-$CUSTOM_GOARCH
custom_output_name=$custom_package'-'$CUSTOM_GOOS-$CUSTOM_GOARCH

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

if [ $? -ne 0 ]; then
echo 'An error occurred! Aborting the script execution...'
exit 1
fi

custom_bin_name=$custom_package
if [ "$CUSTOM_GOOS" == 'windows' ]; then
custom_bin_name=$custom_package'.exe'
fi

cd custom-platforms-$custom_tag
mv $custom_output_name $custom_bin_name
tar -czvf $custom_output_name-$custom_tag.tar.gz $custom_bin_name
rm -rf $custom_bin_name
cd ..
done
Binary file modified static/images/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2001499

Please sign in to comment.