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
Allow bundling with local govuk_frontend_toolkit #1035
Changes from all commits
8dd9c20
e367bad
995e55d
111450c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,30 @@ | ||
#!/bin/bash | ||
#!/bin/bash | ||
|
||
bundle install | ||
|
||
if [[ $1 == "--test-govuk-frontend-toolkit" ]] ; then | ||
# Find out where it the gem is installed | ||
installed_location="$(bundle show govuk_frontend_toolkit | sed -1p)" | ||
temporary_location="./tmp/govuk_frontend_toolkit_gem_dev" | ||
|
||
# Remove any existing tmp file | ||
rm -rf ${temporary_location} | ||
|
||
# Copy the old assets aside | ||
# Using sudo here since the installed location has elevated permissions | ||
sudo cp -r ${installed_location} ${temporary_location} | ||
|
||
# Remove current submoduled assets | ||
rm -rf ${temporary_location}/app/assets | ||
|
||
# Symlink the local | ||
sudo ln -rs ../govuk_frontend_toolkit ${temporary_location}/app/assets | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my local
If we add a Not sure what the best solution is TBH. |
||
|
||
export GOVUK_FRONTEND_TOOLKIT_DEV=true | ||
|
||
bundle install | ||
|
||
echo "Testing local govuk_frontend_toolkit" | ||
fi | ||
|
||
bundle exec rails s -p 3013 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line failed for me on the dev VM for a couple of reasons.
sed -1p
is not supported on the dev VM, on the assumption that1p
is the sed command we want to run it should besed '1p'
.The dev VM is currently pinned to a version of bundler (1.15.1) that shows a warning message if the version of bundler is older than the most recent, and this appears on stdout so it's included in the message. We can disable this with an environment variable
BUNDLE_DISABLE_VERSION_CHECK
.Putting this all together I had to change this to:
However, this outputs the path twice for some reason:
If I drop the
sed
part entirely then it only outputs the path once, which feels like it's what we're after: