Merge pull request #1822 from roots/browsersync-install-options
Add option to configure build settings
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
### HEAD
|
||||||
|
* Add option to configure build settings ([#1822](https://github.com/roots/sage/pull/1822))
|
||||||
|
* Add support for HTML injection ([#1817](https://github.com/roots/sage/pull/1817))
|
||||||
|
|
||||||
### 9.0.0-beta.2: January 19th, 2016
|
### 9.0.0-beta.2: January 19th, 2016
|
||||||
* Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815))
|
* Fix Browersync ([#1815](https://github.com/roots/sage/pull/1815))
|
||||||
* Add option to select CSS framework, add Foundation as an option ([#1813](https://github.com/roots/sage/pull/1813))
|
* Add option to select CSS framework, add Foundation as an option ([#1813](https://github.com/roots/sage/pull/1813))
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ During theme installation you will have the options to:
|
|||||||
* Update theme headers (theme name, description, author, etc.)
|
* Update theme headers (theme name, description, author, etc.)
|
||||||
* Select a CSS framework (Bootstrap, Foundation, none)
|
* Select a CSS framework (Bootstrap, Foundation, none)
|
||||||
* Add Font Awesome
|
* Add Font Awesome
|
||||||
|
* Configure Browsersync (path to theme, local development URL)
|
||||||
|
|
||||||
## Theme structure
|
## Theme structure
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,8 @@
|
|||||||
"post-create-project-cmd": [
|
"post-create-project-cmd": [
|
||||||
"Roots\\Sage\\PostCreateProject::updateHeaders",
|
"Roots\\Sage\\PostCreateProject::updateHeaders",
|
||||||
"Roots\\Sage\\PostCreateProject::selectFramework",
|
"Roots\\Sage\\PostCreateProject::selectFramework",
|
||||||
"Roots\\Sage\\PostCreateProject::addFontAwesome"
|
"Roots\\Sage\\PostCreateProject::addFontAwesome",
|
||||||
|
"Roots\\Sage\\PostCreateProject::buildOptions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,5 +98,27 @@ class PostCreateProject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function buildOptions(Event $event)
|
||||||
|
{
|
||||||
|
$io = $event->getIO();
|
||||||
|
|
||||||
|
if ($io->isInteractive()) {
|
||||||
|
$io->write('<info>Configure build settings. Press enter key for default.</info>');
|
||||||
|
|
||||||
|
$browsersync_settings_default = [
|
||||||
|
'publicPath' => '/app/themes/'.basename(getcwd()),
|
||||||
|
'devUrl' => 'http://example.dev'
|
||||||
|
];
|
||||||
|
|
||||||
|
$browsersync_settings = [
|
||||||
|
'publicPath' => $io->ask('<info>Path to theme directory (eg. /wp-content/themes/sage) [<comment>'.$browsersync_settings_default['publicPath'].'</comment>]:</info> ', $browsersync_settings_default['publicPath']),
|
||||||
|
'devUrl' => $io->ask('<info>Local development URL of WP site [<comment>'.$browsersync_settings_default['devUrl'].'</comment>]:</info> ', $browsersync_settings_default['devUrl'])
|
||||||
|
];
|
||||||
|
|
||||||
|
file_put_contents('assets/config.json', str_replace('/app/themes/sage', $browsersync_settings['publicPath'], file_get_contents('assets/config.json')));
|
||||||
|
file_put_contents('assets/config.json', str_replace($browsersync_settings_default['devUrl'], $browsersync_settings['devUrl'], file_get_contents('assets/config.json')));
|
||||||
|
}
|
||||||
|
}
|
||||||
// @codingStandardsIgnoreEnd
|
// @codingStandardsIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user