Commit f775b1f6 authored by Adrian Rossouw's avatar Adrian Rossouw

Change how the named-context-save command works.

Because the alias does not exist when it is first called, we need to
specify it as the first argument.

So:
drush provision-context-save @myalias --option=123 --option=321

What we are actually doing is saving the alias to the local server,
which is implied by not having a named context before the command
parent d0bcac8a
......@@ -60,7 +60,7 @@ include_once('provision.inc');
* @see provision_load_critical()
*/
function provision_drush_init() {
d(drush_get_option('hosting-name', '@self'), TRUE);
d(drush_get_option('name', '@self', 'alias'), TRUE);
$load = sys_getloadavg();
if (provision_load_critical($load)) {
......@@ -215,8 +215,8 @@ function drush_provision_hostmaster_make($platform) {
drush_backend_invoke('make', array(dirname(__FILE__) . '/aegir.make', $platform));
}
function drush_provision_named_context_save() {
d()->write_alias();
function drush_provision_named_context_save($alias = null) {
d($alias)->write_alias();
}
function drush_provision_named_context_delete() {
......
......@@ -77,7 +77,7 @@ class provisionEnvironment {
*/
function __get($name) {
if ($name == 'options') {
return array_merge(drush_sitealias_get_record($this->name), drush_get_context('stdin'));
return array_merge(drush_sitealias_get_record($this->name), drush_get_context('stdin'), drush_get_context('options'));
}
if (array_key_exists($name, $this->properties)) {
if (isset($this->oid_map[$name]) && !empty($this->properties[$name])) {
......
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