Commit 7d8bfc48 authored by anarcat's avatar anarcat

allow writing config files to arbitrary locations

parent bdbe4618
......@@ -187,8 +187,10 @@ class Provision_Config {
* 5. Render template with $this and $data and write out to filename().
* 6. If $mode and/or $group are set, apply them for the new file.
*/
function write() {
$filename = $this->filename();
function write($filename = NULL) {
if (is_null($filename)) {
$filename = $this->filename();
}
// Make directory structure if it does not exist.
if ($filename && !provision_file()->exists(dirname($filename))->status()) {
provision_file()->mkdir(dirname($filename))
......
......@@ -161,9 +161,9 @@ function provision_drupal_fetch_site($alias = NULL) {
/**
* Generate a settings file for the site.
*/
function _provision_drupal_create_settings_file() {
function _provision_drupal_create_settings_file($filename) {
$config = new Provision_Config_Drupal_Settings(d()->name, drush_get_context('site'));
$config->write();
$config->write($filename);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment