Skip to content
Merged
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
3 changes: 2 additions & 1 deletion bin/dummy-app
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ function unbundled {
test "$DB" = "sqlite" && export DB="sqlite3"

rm -rf ./dummy-app
rails ${RAILS_VERSION:+_${RAILS_VERSION}_} new dummy-app \
rails_version=`bundle exec ruby -e'require "rails"; puts Rails.version'`
rails _${rails_version}_ new dummy-app \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've had issues with using this setup calling bundle exec, inside the script, thoughts on doing it the other way around and updating the sandbox instead?

Using the env var seems more adaptable to different situations and the Gemfile would be based on an environment variable anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The issue is that in the script context, $RAILS_VERSION is expected to be an actual version, like 7.0 or 6.2. However, in other places of the Solidus ecosystem is expected to be a semver reference, like ~> 7.0. See docker config on main Solidus or the CircleCI orb as examples. (I use docker for development, and my docker-compose file had the env var; that was how it hit me πŸ˜…).

Do you recall which problem you found with bundle exec? At first sight, it looks like the safest way to get the actual version that we're using.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No I think it was related to versions of bundler one nested into the other, but I don't have any reference, let's go with this code and if the problem comes up again we can switch to another solution πŸ‘

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All right, thanks, @elia!

--database=${DB:-sqlite3} \
--skip-git \
--skip-rc
Expand Down