mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Ameba cli & binary (#7)
* Ameba cli & binary * -1 when ameba found issues * Add postscript to shard.yml * Correct postinstall * Remove targets * Try executables
This commit is contained in:
parent
0ca990dd5c
commit
6ca4e38167
7 changed files with 41 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,6 @@
|
|||
/doc/
|
||||
/lib/
|
||||
/bin/
|
||||
/bin/ameba
|
||||
/.shards/
|
||||
|
||||
# Libraries don't need dependency lock
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
language: crystal
|
||||
after_script:
|
||||
- make build
|
||||
- ./bin/ameba
|
||||
|
|
10
Makefile
Normal file
10
Makefile
Normal file
|
@ -0,0 +1,10 @@
|
|||
CRYSTAL_BIN ?= $(shell which crystal)
|
||||
PREFIX ?= /usr/local
|
||||
|
||||
build:
|
||||
$(CRYSTAL_BIN) build --release --no-debug -o bin/ameba src/cli.cr $(CRFLAGS)
|
||||
clean:
|
||||
rm -f ./bin/ameba
|
||||
install: build
|
||||
mkdir -p $(PREFIX)/bin
|
||||
cp ./bin/ameba $(PREFIX)/bin
|
0
bin/.keep
Normal file
0
bin/.keep
Normal file
|
@ -1,9 +1,13 @@
|
|||
name: ameba
|
||||
version: 0.1.0
|
||||
|
||||
crystal: 0.23.1
|
||||
license: MIT
|
||||
authors:
|
||||
- Vitalii Elenhaupt <velenhaupt@gmail.com>
|
||||
|
||||
crystal: 0.23.1
|
||||
scripts:
|
||||
postinstall: make build
|
||||
|
||||
license: MIT
|
||||
executables:
|
||||
- ameba
|
||||
|
|
|
@ -23,6 +23,7 @@ module Ameba
|
|||
reporter.report source
|
||||
end
|
||||
reporter.try &.finish sources
|
||||
sources
|
||||
end
|
||||
|
||||
def catch(source : Source)
|
||||
|
|
20
src/cli.cr
Normal file
20
src/cli.cr
Normal file
|
@ -0,0 +1,20 @@
|
|||
require "option_parser"
|
||||
require "./ameba"
|
||||
|
||||
OptionParser.parse(ARGV) do |parser|
|
||||
parser.banner = "Usage: ameba [options]"
|
||||
|
||||
parser.on("-v", "--version", "Print version") do
|
||||
puts Ameba::VERSION
|
||||
exit 0
|
||||
end
|
||||
|
||||
parser.on("-h", "--help", "Show this help") do
|
||||
puts parser
|
||||
exit 0
|
||||
end
|
||||
end
|
||||
|
||||
sources = Ameba.run
|
||||
failed = sources.any? { |s| !s.valid? }
|
||||
exit(-1) if failed
|
Loading…
Reference in a new issue