Skip to content

Commit

Permalink
update install method
Browse files Browse the repository at this point in the history
  • Loading branch information
shenwei356 committed Nov 22, 2016
1 parent 0da27e5 commit b037d13
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,18 @@ executable file of your operating system, and uncompress it with `tar -zxvf *.ta
You can add the directory of the executable file to environment variable
`PATH`, so you can run `csvtk` anywhere.

1. For windows, the simplest way is copy it to `C:\WINDOWS\system32`.
1. For Unix-like systems
1. If you have root privilege simply copy it to `/usr/local/bin`:

2. For Linux, type:
sudo cp csvtk /usr/local/bin/

chmod a+x /PATH/OF/CSVTK/csvtk
echo export PATH=\$PATH:/PATH/OF/CSVTK >> ~/.bashrc
1. Or add the current directory of the executable file to environment variable
`PATH`:

or simply copy it to `/usr/local/bin`
echo export PATH=\$PATH:\"$(pwd)\" >> ~/.bashrc
source ~/.bashrc

1. **For windows**, just copy `csvtk.exe` to `C:\WINDOWS\system32`.

For Go developer, just one command:

Expand Down
6 changes: 5 additions & 1 deletion csvtk/cmd/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func getFileList(args []string) []string {
files = append(files, "-")
} else {
for _, file := range files {
if file == "-" {
if isStdin(file) {
continue
}
if _, err := os.Stat(file); os.IsNotExist(err) {
Expand Down Expand Up @@ -590,3 +590,7 @@ type orderedFields []orderedField
func (s orderedFields) Len() int { return len(s) }
func (s orderedFields) Less(i, j int) bool { return s[i].order < s[j].order }
func (s orderedFields) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

func isStdin(file string) bool {
return file == "-"
}
8 changes: 4 additions & 4 deletions doc/docs/download.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ executable file of your operating system,
and uncompress it with `tar -zxvf *.tar.gz` command or other tools.
And then:

1. **For Linux-like systems**
1. For Unix-like systems
1. If you have root privilege simply copy it to `/usr/local/bin`:

sudo cp csvtk /usr/local/bin/

1. Or add the directory of the executable file to environment variable
1. Or add the current directory of the executable file to environment variable
`PATH`:

echo export PATH=\$PATH:/PATH/OF/csvtk >> ~/.bashrc

echo export PATH=\$PATH:\"$(pwd)\" >> ~/.bashrc
source ~/.bashrc

1. **For windows**, just copy `csvtk.exe` to `C:\WINDOWS\system32`.

Expand Down
2 changes: 1 addition & 1 deletion doc/site
Submodule site updated from e63fb3 to 642273

0 comments on commit b037d13

Please sign in to comment.