Skip to content

Commit

Permalink
Add install script for setting up csvdiff. Fixes #16 (#17)
Browse files Browse the repository at this point in the history
* Add install script for setting up csvdiff. Fixes #16

* Modify readme to install latest version

* Rename aswinkarthik93 to aswinkarthik
  • Loading branch information
kishaningithub authored and aswinkarthik committed Oct 29, 2018
1 parent 83dd3da commit b94cc7e
Show file tree
Hide file tree
Showing 16 changed files with 425 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.idea/*

out/

# End of https://www.gitignore.io/api/go
Expand Down
11 changes: 9 additions & 2 deletions goreleaser.yml → .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
project_name: csvdiff

release:
github:
owner: aswinkarthik
name: csvdiff

builds:
- main: ./main.go
binary: csvdiff
Expand All @@ -14,8 +21,8 @@ nfpm:
386: 32-bit
darwin: macOS
linux: linux
homepage: https://github.com/aswinkarthik93/csvdiff
maintainer: aswinkarthik93
homepage: https://github.com/aswinkarthik/csvdiff
maintainer: aswinkarthik
description: A Blazingly fast diff tool for comparing csv files.
license: MIT
formats:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2018 aswinkarthik93
Copyright © 2018 aswinkarthik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 17 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# csvdiff

[![Build Status](https://travis-ci.org/aswinkarthik93/csvdiff.svg?branch=master)](https://travis-ci.org/aswinkarthik93/csvdiff)
[![Go Doc](https://godoc.org/github.com/aswinkarthik93/csvdiff?status.svg)](https://godoc.org/github.com/aswinkarthik93/csvdiff)
[![Go Report Card](https://goreportcard.com/badge/github.com/aswinkarthik93/csvdiff)](https://goreportcard.com/report/github.com/aswinkarthik93/csvdiff)
[![codecov](https://codecov.io/gh/aswinkarthik93/csvdiff/branch/master/graph/badge.svg)](https://codecov.io/gh/aswinkarthik93/csvdiff)
[![Downloads](https://img.shields.io/github/downloads/aswinkarthik93/csvdiff/latest/total.svg)](https://github.com/aswinkarthik93/csvdiff/releases)
[![Latest release](https://img.shields.io/github/release/aswinkarthik93/csvdiff.svg)](https://github.com/aswinkarthik93/csvdiff/releases)
[![Build Status](https://travis-ci.org/aswinkarthik/csvdiff.svg?branch=master)](https://travis-ci.org/aswinkarthik/csvdiff)
[![Go Doc](https://godoc.org/github.com/aswinkarthik/csvdiff?status.svg)](https://godoc.org/github.com/aswinkarthik/csvdiff)
[![Go Report Card](https://goreportcard.com/badge/github.com/aswinkarthik/csvdiff)](https://goreportcard.com/report/github.com/aswinkarthik/csvdiff)
[![codecov](https://codecov.io/gh/aswinkarthik/csvdiff/branch/master/graph/badge.svg)](https://codecov.io/gh/aswinkarthik/csvdiff)
[![Downloads](https://img.shields.io/github/downloads/aswinkarthik/csvdiff/latest/total.svg)](https://github.com/aswinkarthik/csvdiff/releases)
[![Latest release](https://img.shields.io/github/release/aswinkarthik/csvdiff.svg)](https://github.com/aswinkarthik/csvdiff/releases)

A Blazingly fast diff tool for comparing csv files.

Expand Down Expand Up @@ -34,40 +34,26 @@ $ csvdiff base.csv delta.csv

## Installation

- For MacOS
### Using binaries

```bash
curl -sL https://github.com/aswinkarthik93/csvdiff/releases/download/v1.0.0/csvdiff_1.0.0_darwin_amd64.tar.gz | tar xfz -
```

- For centos

```bash
yum install https://github.com/aswinkarthik93/csvdiff/releases/download/v1.0.0/csvdiff_1.0.0_linux_64-bit.rpm
```
# binary will be $GOPATH/bin/csvdiff
curl -sfL https://raw.githubusercontent.com/aswinkarthik/csvdiff/master/install.sh | sh -s -- -b $GOPATH/bin

- For debian
# or install it into ./bin/
curl -sfL https://raw.githubusercontent.com/aswinkarthik/csvdiff/master/install.sh | sh -s

```bash
curl -sL https://github.com/aswinkarthik93/csvdiff/releases/download/v1.0.0/csvdiff_1.0.0_linux_64-bit.deb -O
dpkg --install csvdiff_*_linux_64-bit.deb
# In alpine linux (as it does not come with curl by default)
wget -O - -q https://raw.githubusercontent.com/aswinkarthik/csvdiff/master/install.sh | sh -s
```

- For Linux

```bash
curl -sL https://github.com/aswinkarthik93/csvdiff/releases/download/v1.0.0/csvdiff_1.0.0_linux_amd64.tar.gz | tar xfz -
```

- For [Windows](https://github.com/aswinkarthik93/csvdiff/releases/download/v1.0.0/csvdiff_1.0.0_windows_amd64.tar.gz)

- Build using Go
### Using source code

```bash
go get -u github.com/aswinkarthik93/csvdiff
go get -u github.com/aswinkarthik/csvdiff
```

## Usecase
## Use case

- Cases where you have a base database dump as csv. If you receive the changes as another database dump as csv, this tool can be used to figure out what are the additions and modifications to the original database dump. The `additions.csv` can be used to create an `insert.sql` and with the `modifications.csv` an `update.sql` data migration.
- The delta file can either contain just the changes or the entire table dump along with the changes.
Expand Down Expand Up @@ -125,7 +111,7 @@ Rows:
## Build locally

```bash
$ git clone https://github.com/aswinkarthik93/csvdiff
$ git clone https://github.com/aswinkarthik/csvdiff
$ go get ./...
$ go build

Expand Down
2 changes: 1 addition & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ sys 0m0.147s

## Go Benchmark Results

Benchmark test can be found [here](https://github.com/aswinkarthik93/csvdiff/blob/master/pkg/digest/digest_benchmark_test.go).
Benchmark test can be found [here](https://github.com/aswinkarthik/csvdiff/blob/master/pkg/digest/digest_benchmark_test.go).

```bash
$ cd ./pkg/digest
Expand Down
2 changes: 1 addition & 1 deletion cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"strings"

"github.com/aswinkarthik93/csvdiff/pkg/digest"
"github.com/aswinkarthik/csvdiff/pkg/digest"
)

var config Config
Expand Down
4 changes: 2 additions & 2 deletions cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd_test
import (
"testing"

"github.com/aswinkarthik93/csvdiff/cmd"
"github.com/aswinkarthik93/csvdiff/pkg/digest"
"github.com/aswinkarthik/csvdiff/cmd"
"github.com/aswinkarthik/csvdiff/pkg/digest"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"io"

"github.com/aswinkarthik93/csvdiff/pkg/digest"
"github.com/aswinkarthik/csvdiff/pkg/digest"
)

// Formatter defines the interface through which differences
Expand Down
4 changes: 2 additions & 2 deletions cmd/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"testing"

"github.com/aswinkarthik93/csvdiff/cmd"
"github.com/aswinkarthik93/csvdiff/pkg/digest"
"github.com/aswinkarthik/csvdiff/cmd"
"github.com/aswinkarthik/csvdiff/pkg/digest"

"github.com/stretchr/testify/assert"
)
Expand Down
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2018 aswinkarthik93
// Copyright © 2018 aswinkarthik
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -27,7 +27,7 @@ import (
"os"
"time"

"github.com/aswinkarthik93/csvdiff/pkg/digest"
"github.com/aswinkarthik/csvdiff/pkg/digest"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/aswinkarthik93/csvdiff
module github.com/aswinkarthik/csvdiff

require (
github.com/BurntSushi/toml v0.3.0 // indirect
Expand Down
Loading

0 comments on commit b94cc7e

Please sign in to comment.