From 24002a121d37e44ad1585726e744636917a15114 Mon Sep 17 00:00:00 2001 From: Joakim Repomaa Date: Fri, 17 Apr 2020 12:58:31 +0200 Subject: [PATCH 1/2] use File::Error for crystal >= 0.34 compatiblility --- src/sentry.cr | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sentry.cr b/src/sentry.cr index 2b58788..170ada4 100644 --- a/src/sentry.cr +++ b/src/sentry.cr @@ -263,13 +263,10 @@ module Sentry file_changed = true if (app_process && !app_process.terminated?) end end - rescue ex : Errno + rescue ex : File::Error # The underlining lib for reading directories will fail very rarely, crashing Sentry # This catches that error and allows Sentry to carry on normally - # https://github.com/crystal-lang/crystal/blob/59788834554399f7fe838487a83eb466e55c6408/src/errno.cr#L37 - unless ex.to_s == "readdir: Input/output error" - raise ex - end + # https://github.com/crystal-lang/crystal/blob/677422167cbcce0aeea49531896dbdcadd2762db/src/crystal/system/unix/dir.cr#L19 end start_app() if (file_changed || app_process.nil?) From 3b1a58a357f548d93ee01348e1a4e156c340f756 Mon Sep 17 00:00:00 2001 From: Joakim Repomaa Date: Tue, 30 Jul 2019 14:59:37 +0200 Subject: [PATCH 2/2] build and copy cli binary in postinstall script --- .gitignore | 1 + Makefile | 14 ++++++++++++++ shard.yml | 7 +++++++ 3 files changed, 22 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 3ccdda2..d9d211f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /.crystal/ /.shards/ /dev/ +/bin/ # Libraries don't need dependency lock # Dependencies will be locked in application that uses them diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4dacfbb --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +all: + +install: ../../bin/sentry + +../../bin/sentry: bin/sentry ../../bin + cp bin/sentry ../../bin/ + +../../bin: + mkdir -p ../../bin + +bin/sentry: + shards build --release sentry + +.PHONY: all install bin/sentry diff --git a/shard.yml b/shard.yml index d7da1ec..4c48cbf 100644 --- a/shard.yml +++ b/shard.yml @@ -1,6 +1,13 @@ name: sentry version: 0.3.1 +scripts: + postinstall: make install + +targets: + sentry: + main: src/sentry_cli.cr + authors: - Sam Eaton crystal: 0.27.0