Skip to content

Commit

Permalink
Prevent development_dependencies from being installed during postinst…
Browse files Browse the repository at this point in the history
…all from a parent shard. (#62)
  • Loading branch information
jwoertink authored Oct 2, 2021
1 parent 743a21d commit e584b30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 9 additions & 1 deletion script/precompile_tasks
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
# Precompile tasks if not in production and not in CI
# Also allow skipping precompilation with an ENV var
if [ "$LUCKY_ENV" != "production" ] && [ -z "$CI" ] && [ -z "$SKIP_LUCKY_TASK_PRECOMPILATION" ]; then
shards build
# This is to prevent Carbon's development dependencies being installed
# from an external source like running `shards install` from a Lucky app.
# Install shards and build shard targets.
if [ -z "$BUILD_WITHOUT_DEVELOPMENT" ]; then
shards build
else
shards build --without-development
fi

mkdir -p ../../bin
cp -r "$PWD/bin" "$PWD/../.."
fi
3 changes: 1 addition & 2 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ development_dependencies:
lucky_env:
github: luckyframework/lucky_env
version: ~> 0.1.1

ameba:
github: crystal-ameba/ameba
version: ~> 0.14.2

scripts:
postinstall: script/precompile_tasks
postinstall: BUILD_WITHOUT_DEVELOPMENT=true script/precompile_tasks

0 comments on commit e584b30

Please sign in to comment.