[WIP] Preview components inside a directory#5
Closed
gorkalaucirica wants to merge 1 commit intomasterfrom
Closed
Conversation
452668a to
e82eb93
Compare
benatespina
suggested changes
Jun 15, 2017
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /* |
Contributor
There was a problem hiding this comment.
Remove second license header
| */ | ||
| class LoadThumbnailsCommand extends Command | ||
| { | ||
| private const CHROME_BIN = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"; |
Contributor
There was a problem hiding this comment.
This path is highly coupled with MacOS
|
|
||
| protected function configure() | ||
| { | ||
| $this->setName('lin3s:pattern-library-builder:load-thumbnails'); |
Contributor
There was a problem hiding this comment.
Call setDescription method with proper explanation
| } | ||
| } | ||
|
|
||
| private function takeScreenshot(array $config) |
Contributor
There was a problem hiding this comment.
Add missing "void" return type
| private function takeScreenshot(array $config) | ||
| { | ||
| $command = sprintf( | ||
| '%s --headless --disable-gpu --screenshot=%s http://localhost:8000%s?media=mobile', |
| $command = sprintf( | ||
| '%s --headless --disable-gpu --screenshot=%s http://localhost:8000%s?media=mobile', | ||
| self::CHROME_BIN, | ||
| __DIR__ . '/../Resources/public/thumbnails/' . mt_rand() . '.png', |
Contributor
There was a problem hiding this comment.
This path is hardcoded
| array_keys($config['config']['preview_parameters'])[0] | ||
| ); | ||
|
|
||
| exec($command); |
Contributor
There was a problem hiding this comment.
Maybe we can you Symfony Process to maintain better compatibility between different envs
Contributor
Author
|
WIP = Not finished yet |
e82eb93 to
9ecaf1a
Compare
Contributor
Author
|
This feature will be implemented using another approach in #12 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.