Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent ameba from being installed during postinstall #1589

Merged
merged 1 commit into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Lucky'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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the typical use case here would be to build without development, should this if be reversed so that the flag doesn't need to be passed in unless you actually want the ancillary binaries?

Do we even need the flag here? Assuming that I actually want the ameba binary I can add that to my own shards.build stanza for the project.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bash skills suck 😅 it should probably be flipped

@edwardloveall and I were talking about this, and we figured if you're working on Lucky directly, maybe there's a time you want to run that script with any dev deps included? I think the 99% case though would be without.


mkdir -p ../../bin
cp -r "$PWD/bin" "$PWD/../.."
fi
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ development_dependencies:
version: ~> 0.14.2

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

license: MIT