Skip to content

Commit 4e88bfd

Browse files
committed
add go1.16 support, update copyright year, doc template added M1 experimental binaries
1 parent 6dc311e commit 4e88bfd

37 files changed

+114
-64
lines changed

INSTALL.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11

2-
# Installation
2+
Installation
3+
============
34

45
*datatools* is a collection of command line programs run from a shell like Bash.
56

6-
## Compiled version
7+
Compiled version
8+
----------------
79

810
This is generalized instructions for a release.
911

10-
Compiled versions are available for Mac OS X (amd64 processor, macosx-amd64), Linux (amd64 process, linux-amd64),
12+
Compiled versions are available for Mac OS X (amd64 and M1 processor, macos-amd64 and macos-arm64), Linux (amd64 process, linux-amd64),
1113
Windows (amd64 processor, windows-amd64) and Rapsberry Pi (arm7 processor, raspbian-arm7)
1214

1315
VERSION_NUMBER is a [symantic version number](http://semver.org/) (e.g. v0.1.2)
@@ -21,20 +23,22 @@ For all the released version go to the project page on Github and click latest r
2123
| Platform | Zip Filename |
2224
|-------------|--------------------------------------------|
2325
| Windows | datatools-VERSION_NUMBER-windows-amd64.zip |
24-
| Mac OS X | datatools-VERSION_NUMBER-macosx-amd64.zip |
26+
| Mac OS X | datatools-VERSION_NUMBER-macos-amd64.zip |
27+
| Mac OS X | datatools-VERSION_NUMBER-macos-arm64.zip |
2528
| Linux/Intel | datatools-VERSION_NUMBER-linux-amd64.zip |
2629
| Raspbery Pi | datatools-VERSION_NUMBER-raspbian-arm7.zip |
2730

2831

29-
## The basic recipe
32+
The basic recipe
33+
----------------
3034

3135
+ Find the Zip file listed matching the architecture you're running and download it
3236
+ (e.g. if you're on a Windows 10 laptop/Surface with a amd64 style CPU you'd choose the Zip file with "windows-amd64" in the name).
3337
+ Download the zip file and unzip the file.
3438
+ Copy the contents of the folder named "bin" to a folder that is in your path
3539
+ (e.g. "$HOME/bin" is common).
3640
+ Adjust your PATH if needed
37-
+ (e.g. `export PATH="$HOME/bin:$PATH"`)
41+
+ (e.g. export PATH="$HOME/bin:$PATH")
3842
+ Test
3943

4044

@@ -51,7 +55,7 @@ zip file.
5155

5256
```shell
5357
cd Downloads/
54-
unzip datatools-*-macosx-amd64.zip
58+
unzip datatools-*-macos-amd64.zip
5559
mkdir -p $HOME/bin
5660
cp -v bin/* $HOME/bin/
5761
export PATH=$HOME/bin:$PATH
@@ -120,7 +124,8 @@ downloading the zip file.
120124
```
121125

122126

123-
## Compiling from source
127+
Compiling from source
128+
---------------------
124129

125130
_datatools_ is "go gettable" if you have gotten xlsx v1.0.5 package from [github.com/tealeg/xlsx](https://github.com/tealeg/xlsx). The datatools package does not support versions v2.x and greater of xlsx. Below are the steps
126131
I use today with "go get" command to download the dependant packages

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Copyright (c) 2019, Caltech
2+
Copyright (c) 2021, Caltech
33
All rights not granted herein are expressly reserved by Caltech.
44

55
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Makefile

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ dist/linux-amd64:
221221
rm -fR dist/bin
222222

223223

224-
dist/macosx-amd64:
224+
dist/macos-amd64:
225225
mkdir -p dist/bin
226226
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/csvcols cmd/csvcols/csvcols.go
227227
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/csvrows cmd/csvrows/csvrows.go
@@ -249,10 +249,41 @@ dist/macosx-amd64:
249249
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/json2toml cmd/json2toml/json2toml.go
250250
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/yaml2json cmd/yaml2json/yaml2json.go
251251
env GOOS=darwin GOARCH=amd64 go build -o dist/bin/json2yaml cmd/json2yaml/json2yaml.go
252-
cd dist && zip -r $(PROJECT)-$(VERSION)-macosx-amd64.zip README.md LICENSE INSTALL.md bin/* docs/* how-to/* demos/*
252+
cd dist && zip -r $(PROJECT)-$(VERSION)-macos-amd64.zip README.md LICENSE INSTALL.md bin/* docs/* how-to/* demos/*
253253
rm -fR dist/bin
254254

255255

256+
dist/macos-arm64:
257+
mkdir -p dist/bin
258+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csvcols cmd/csvcols/csvcols.go
259+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csvrows cmd/csvrows/csvrows.go
260+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csvfind cmd/csvfind/csvfind.go
261+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csvjoin cmd/csvjoin/csvjoin.go
262+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/jsoncols cmd/jsoncols/jsoncols.go
263+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/jsonrange cmd/jsonrange/jsonrange.go
264+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/xlsx2json cmd/xlsx2json/xlsx2json.go
265+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/xlsx2csv cmd/xlsx2csv/xlsx2csv.go
266+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csv2mdtable cmd/csv2mdtable/csv2mdtable.go
267+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csv2xlsx cmd/csv2xlsx/csv2xlsx.go
268+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csv2json cmd/csv2json/csv2json.go
269+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/jsonmunge cmd/jsonmunge/jsonmunge.go
270+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/jsonjoin cmd/jsonjoin/jsonjoin.go
271+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/findfile cmd/findfile/findfile.go
272+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/finddir cmd/finddir/finddir.go
273+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/mergepath cmd/mergepath/mergepath.go
274+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/reldate cmd/reldate/reldate.go
275+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/range cmd/range/range.go
276+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/timefmt cmd/timefmt/timefmt.go
277+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/urlparse cmd/urlparse/urlparse.go
278+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/csvcleaner cmd/csvcleaner/csvcleaner.go
279+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/string cmd/string/string.go
280+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/toml2json cmd/toml2json/toml2json.go
281+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/json2toml cmd/json2toml/json2toml.go
282+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/yaml2json cmd/yaml2json/yaml2json.go
283+
env GOOS=darwin GOARCH=arm64 go build -o dist/bin/json2yaml cmd/json2yaml/json2yaml.go
284+
cd dist && zip -r $(PROJECT)-$(VERSION)-macos-arm64.zip README.md LICENSE INSTALL.md bin/* docs/* how-to/* demos/*
285+
rm -fR dist/bin
286+
256287

257288
dist/windows-amd64:
258289
mkdir -p dist/bin
@@ -329,5 +360,5 @@ distribute_docs:
329360
cp -vR how-to dist/
330361
./package-versions.bash > dist/package-versions.txt
331362

332-
release: distribute_docs dist/linux-amd64 dist/macosx-amd64 dist/windows-amd64 dist/raspbian-arm7
363+
release: distribute_docs dist/linux-amd64 dist/macos-amd64 dist/macos-arm64 dist/windows-amd64 dist/raspbian-arm7
333364

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11

2-
# datatools
2+
datatools
3+
=========
34

45
_datatools_ provides a variety of command line programs for working with
56
data in different formats as well as to ease Posix shell scripting
67
(e.g. writing scripts that run under Bash). The tools are group as data,
78
strings and scripting.
89

9-
## For data
10+
For data
11+
--------
1012

1113
Command line utilities for simplifying work with CSV, JSON, TOML, YAML,
1214
Excel Workbooks and plain text files or content.
@@ -36,7 +38,8 @@ Windows 10 (amd64) and Raspbian (ARM7). See https://github.com/caltechlibrary/da
3638

3739
Use "-help" option for a full list of options for each utility (e.g. `csv2json -help`).
3840

39-
## For strings
41+
For strings
42+
-----------
4043

4144
_datatools_ provides the [string](docs/string/) command for working with
4245
text strings (limited to memory available). This is commonly needed when
@@ -64,7 +67,8 @@ Some of the features included
6467

6568
See [string](docs/string/) for full details
6669

67-
## For scripting
70+
For scripting
71+
-------------
6872

6973
Various utilities for simplifying work on the command line.
7074

@@ -82,7 +86,8 @@ Windows 10 (amd64) and Raspbian (ARM7). See https://github.com/caltechlibrary/da
8286
Use the utilities try "-help" option for a full list of options.
8387

8488

85-
## Installation
89+
Installation
90+
------------
8691

8792
See [INSTALL.md](install.html) for details for installing pre-compiled
8893
versions of the programs.

RELEASES.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

2-
# Release Process and tags
2+
Release Process and tags
3+
========================
34

4-
## Preleases and production releases
5+
Preleases and production releases
6+
---------------------------------
57

68
This describes a simple release process organized around semantic versioned tags.
79

@@ -20,13 +22,15 @@ be followed by v0.0.10-pre, v0.0.11-pre, v0.0.12-pre before a v0.0.12 appears as
2022

2123
Production and pre-releases should include Zip files of the compiled cli to be tested by `bash test_cmds.bash`.
2224

23-
## Dev releases
25+
Dev releases
26+
------------
2427

2528
Dev release may happend from time to time as needed. They should always end in a '-dev' version number (e.g. v0.0.10-dev).
2629
They normally should not have any pre-compiled binaries to avoid confusion. They should be flagged as draft (pre-release)
2730
on Github.
2831

29-
## Making a release
32+
Making a release
33+
----------------
3034

3135
1. Set the version number in PACKAGE.go (where PACKAGE is the name of the package, e.g. dataset is the name of the dataset
3236
package so you'd change the version number in dataset.go).

TODO.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11

2-
# Action Items
2+
Action Items
3+
------------
34

4-
## Bug
5+
Bug
6+
---
57

68
+ [ ] findfile v0.0.23-pre option -f, -full-path doesn't return full paths
79

8-
## Next
10+
Next
11+
----
912

1013
+ [ ] upgrade to use the new cli v0.0.5-dev
1114
+ [ ] csvrows would output a range of rows (e.g. [2:] would be all rows but the first row)
1215
+ [ ] csv utilities should support integer ranges notation for columns and rows references, E.g. "1,3:4,7,10:" or all
1316

14-
## Someday, Maybe
17+
Someday, Maybe
18+
--------------
1519

1620
+ [ ] finddir should have an option to exclude directories (e.g. exclude .git directories from a listing)
1721
+ [ ] textscraper - a tool for select out text and storing it as a JSON field value, sort grep plus sed cleanup and semi-structured text (e.g. webpage)
@@ -54,7 +58,8 @@
5458
+ [ ] show lines with prefix, suffix, containing or regxp
5559
+ [ ] show lines without prefix, suffix, containing or regexp
5660

57-
## Completed
61+
Completed
62+
---------
5863

5964
+ [x] consolidate string utilities (e.g. toupper, tolower, totitle) into string cli
6065
+ [x] csvcols -col option should not be a boolean, it should take a range like other csv cli

cmd/csv2json/csv2json.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//
88
// @author R. S. Doiel, <[email protected]>
99
//
10-
// Copyright (c) 2017, Caltech
10+
// Copyright (c) 2021, Caltech
1111
// All rights not granted herein are expressly reserved by Caltech.
1212
//
1313
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csv2mdtable/csv2mdtable.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csv2xlsx/csv2xlsx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @Author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csvcleaner/csvcleaner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csvcols/csvcols.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csvfind/csvfind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csvjoin/csvjoin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/csvrows/csvrows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/finddir/finddir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// @author R. S. Doiel, <[email protected]>
77
//
8-
// Copyright (c) 2019, Caltech
8+
// Copyright (c) 2021, Caltech
99
// All rights not granted herein are expressly reserved by Caltech.
1010
//
1111
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/findfile/findfile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// @author R. S. Doiel, <[email protected]>
77
//
8-
// Copyright (c) 2019, Caltech
8+
// Copyright (c) 2021, Caltech
99
// All rights not granted herein are expressly reserved by Caltech.
1010
//
1111
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/json2toml/json2toml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @Author R. S. Doiel
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/json2yaml/json2yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @Author R. S. Doiel
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/mergepath/mergepath.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @Author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/range/range.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @Author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/reldate/reldate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// @Author R. S. Doiel, <[email protected]>
66
//
7-
// Copyright (c) 2019, Caltech
7+
// Copyright (c) 2021, Caltech
88
// All rights not granted herein are expressly reserved by Caltech.
99
//
1010
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/string/string.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

cmd/timefmt/timefmt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//
44
// @Author R. S. Doiel, <[email protected]>
55
//
6-
// Copyright (c) 2019, Caltech
6+
// Copyright (c) 2021, Caltech
77
// All rights not granted herein are expressly reserved by Caltech.
88
//
99
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

0 commit comments

Comments
 (0)