Skip to content

Commit

Permalink
spring cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
IdlePhysicist committed Jun 5, 2020
1 parent 2ad76db commit 959b68e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Environment Variables
CGO=1
SRC=cmd
BUILD=build
CGO =1
SRC =cmd
BUILD =build
PREFIX=$(GOPATH)/bin/

version?="0.0.0"
commit=`if [ -d ./.git ]; then git rev-list -1 HEAD | head -c 8; else echo "release build"; fi`
date=`date "+%Y-%m-%d"`
package=main
ldflags="-X $(package).commit=$(commit) -X $(package).version=$(version) -X $(package).date=$(date)"
commit =`if [ -d ./.git ]; then git rev-list -1 HEAD | head -c 8; else echo "release build"; fi`
date =`date "+%Y-%m-%d"`
package =main
ldflags ="-X $(package).commit=$(commit) -X $(package).version=$(version) -X $(package).date=$(date)"

default: darwin

Expand All @@ -23,4 +25,4 @@ clean:
touch $(BUILD)/.keep

install:
mv $(BUILD)/cave-logger $(GOPATH)/bin/.
mv $(BUILD)/cave-logger $(PREFIX)
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,32 @@ I indend to make the code more generic to allow other outdoorsy people to use th
## What It Looks Like
<p align="center"><img src="assets/screenshot.png"></p>

## Getting started

### Install
## Install
You can install by the following set of instructions:

1. Clone or download the repo, and naviagte to the repo directory
2. Compile the binary
- `make darwin` on a mac
- `make linux` on linux
3. Assuming the binary has built correctly then you have two courses of action:
- A. If you have no data to import from another media (or wish to manually insert your data) then simply run `./scripts/make-db.py` and this will create a correctly formatted sqlite database and a config file
- A. If you have no data to import from another media (or wish to manually insert your data) then simply run `./scripts/make-db.py` and this will create a correctly formatted sqlite database and a config file. This script will also check for a pre-existing config file so as not to overwrite one.
- B. If you do wish to import existing records then I have a Python script under `./scripts/csv2sqlite.py` that you can modify to your purposes. Note this script will create the database for itself.
4. Finally run `make install`.
5. You will now (provided you have a GOPATH set up) be able to run the application by running `cave-logger` in your shell.
5. You will now (provided you have a GOPATH set up) be able to run the application by running `cave-logger` in your shell. This can be overridden with the `PREFIX` variable, i.e. `make PREFIX=/usr/local/bin`.

### Homebrew
Tap repo [here](https://github.com/IdlePhysicist/homebrew-caving)
```
brew tap idlephysicist/caving
brew install idlephysicist/caving/cave-logger
```

#### Docker
### Docker
To run in docker:

1. Clone or download the repo, and naviagte to the repo directory
2. Follow step 3 from above
3. `./run-in-docker`
3. `./docker/run.sh`

## Help

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion run-in-docker → docker/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

docker build -t cave-logger .
docker build -t cave-logger ./docker/.

docker run \
--interactive \
Expand Down

0 comments on commit 959b68e

Please sign in to comment.