Skip to content
This repository was archived by the owner on Aug 29, 2021. It is now read-only.

Commit 7ad9d54

Browse files
committed
Make thing installable with "go install"
1 parent 885a4fe commit 7ad9d54

File tree

5 files changed

+28
-15
lines changed

5 files changed

+28
-15
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,28 +36,41 @@ of which don't require much runtime to be around (except for basics like libc)
3636
[downloaded here](http://fraggod.net/static/code/codetag) (x86 ELF32) (usual
3737
warning about downloading binaries via http applies).
3838

39-
To build the thing from source:
39+
To build the thing from source using go packaging tools:
4040

41-
* [Install Go](http://www.golang.org/).
41+
* [Install Go](http://www.golang.org/).
4242

43-
* Fetch the go package deps:
43+
* Easy option: use
44+
["go install"](https://golang.org/cmd/go/#hdr-Compile_and_install_packages_and_dependencies)
45+
to pull in all the deps and build the tool:
4446

45-
go get -u github.com/vaughan0/go-logging
46-
go get -u github.com/kylelemons/go-gypsy/yaml
47+
go install github.com/mk-fg/codetag
4748

48-
Be sure to update these packages when trying to build a new codetag version.
49+
This should produce no output and just exit with success.
50+
Compiled binary will be in the "$GOROOT/bin" path.
4951

50-
* Get the code: `git clone https://github.com/mk-fg/codetag`
52+
That's it, all done.
5153

52-
* Build the code:
5354

54-
cd codetag
55-
make
55+
* Alternative to the above (aka the hard way): clone repo and build manually.
5656

57-
TODO: move/symlink stuff around, so that "go install" would work
57+
* Fetch go package deps:
5858

59-
* Binary will be in the "bin/codetag" path, and can be installed via usual
60-
means e.g. `sudo install -m755 bin/codetag /usr/local/bin`.
59+
go get -u github.com/vaughan0/go-logging
60+
go get -u github.com/kylelemons/go-gypsy/yaml
61+
62+
Be sure to update these packages when trying to build a new codetag version.
63+
64+
* Get the code: `git clone https://github.com/mk-fg/codetag`
65+
66+
* Build the code:
67+
68+
cd codetag
69+
make
70+
71+
* Binary will be in the "bin/codetag" path, and can be installed to $PATH (if
72+
necessary) via usual means e.g. `sudo install -m755 bin/codetag
73+
/usr/local/bin`.
6174

6275

6376
Usage

default.do

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PROJECT=codetag
44

5-
DEPS=$(find src -type f -name '*.go')
5+
DEPS=$(find -type f -name '*.go')
66

77
redo-ifchange $DEPS
88

@@ -22,7 +22,7 @@ go build -o "$3" "${PROJECT}" >"$output" 2>&1 || err=$?
2222
if [[ -z "$gpp" ]]
2323
then cat "$output" >&2 ||:
2424
else
25-
gawk 'match($0, /^((src|..)\/\S+\.go):([0-9]+):/, a) {
25+
gawk 'match($0, /^((..)\/\S+\.go):([0-9]+):/, a) {
2626
print; system("'"$gpp"' -n show -p -c2 -n" a[3] " " a[1]);
2727
next} {print}' "$output" >&2 ||:
2828
# Doesn't highlight the relevant line:
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)