Skip to content

Commit

Permalink
Install binary to shard/bin folder
Browse files Browse the repository at this point in the history
Just a workaround before crystal-lang/shards#126
becomes live.
  • Loading branch information
veelenga committed Nov 16, 2017
1 parent 7546a80 commit 6a28e21
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CRYSTAL_BIN ?= $(shell which crystal)
PREFIX ?= /usr/local
SHARD_BIN ?= ../../bin

build:
$(CRYSTAL_BIN) build --release --no-debug -o bin/ameba src/cli.cr $(CRFLAGS)
Expand All @@ -8,6 +9,9 @@ clean:
install: build
mkdir -p $(PREFIX)/bin
cp ./bin/ameba $(PREFIX)/bin
bin: build
mkdir -p $(SHARD_BIN)
cp ./bin/ameba $(SHARD_BIN)
test: build
$(CRYSTAL_BIN) spec
./bin/ameba
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,18 @@ development_dependencies:
github: veelenga/ameba
```
Compile and install `ameba` binary onto your system while running `crystal deps`.
Build `bin/ameba` binary within your project directory while running `crystal deps`.

You may want also use it on [Travis](travis-ci.org):

```yaml
language: crystal
install:
- crystal deps
script:
- crystal spec
- bin/ameba
```

### OS X

Expand Down
3 changes: 2 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ authors:
- Vitalii Elenhaupt <[email protected]>

scripts:
postinstall: make build
postinstall: make bin

# https://github.com/crystal-lang/shards/pull/126
executables:
- ameba

0 comments on commit 6a28e21

Please sign in to comment.