-
Notifications
You must be signed in to change notification settings - Fork 31
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
Update/composer install lib #35
Conversation
@dkotter this is probably worth a review to get into the 1.9.10 release to ensure things work smoothly as our first release under 10up / using our GitHub Actions. |
@@ -13,8 +13,7 @@ jobs: | |||
uses: actions/checkout@v2 | |||
- name: Build | |||
run: | | |||
npm install | |||
npm run build | |||
composer install |
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.
It looks like we have a similar build command in the wordpress-plugin-asset-update.yml file. Should that be updated as well?
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.
Thanks! I missed that other build command. That's been updated now!
safe-svg.php
Outdated
@@ -14,7 +14,7 @@ | |||
|
|||
defined( 'ABSPATH' ) or die( 'Really?' ); | |||
|
|||
require 'lib/vendor/autoload.php'; | |||
require 'vendor/autoload.php'; |
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.
Since we aren't committing this file to the repo anymore, I think we need to add a conditional around this so those that are directly checking this repo out don't end up with a fatal error if they haven't run composer install
.
Something like:
require 'vendor/autoload.php'; | |
// Try and include our autoloader. | |
if ( is_readable( __DIR__ . '/vendor/autoload.php' ) ) { | |
require __DIR__ . '/vendor/autoload.php'; | |
} else { | |
add_action( 'admin_notices', function() { ?> | |
<div class="notice notice-error"> | |
<?php /* translators: %1$s: composer command */ ?> | |
<p><?php echo wp_kses_post( sprintf( __( 'You appear to be running a development version of Safe SVG. Please run %1$s in order for things to work properly.', 'safe-svg' ), '<code>composer install</code>' ) ); ?></p> | |
</div> | |
<?php | |
} ); | |
return; | |
} |
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.
Good call, I've added this in 🙂
Should probably also add |
@dkotter, thanks for taking a look. I've made those updates to the PR! |
Description of the Change
composer install
rather thannpm run build
.Checklist:
Changelog Entry