diff --git a/README.md b/README.md index 9989e14..5cdf99c 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,10 @@ MIT license, please see the LICENSE file. All rights reserved._ Application Environment env List application environment variables - env-add Add an environment variable to an application - env-del Delete an environment variable to an application + env-add + [--no-restart] Add an environment variable to an application + env-del + [--no-restart] Delete an environment variable to an application Services services Lists of services available and provisioned diff --git a/lib/cli/commands/apps.rb b/lib/cli/commands/apps.rb index 581aa3a..308c028 100644 --- a/lib/cli/commands/apps.rb +++ b/lib/cli/commands/apps.rb @@ -429,6 +429,7 @@ def environment(appname) end def environment_add(appname, k, v=nil) + no_restart = @options[:norestart] app = client.app_info(appname) env = app[:env] || [] k,v = k.split('=', 2) unless v @@ -437,7 +438,7 @@ def environment_add(appname, k, v=nil) app[:env] = env client.update_app(appname, app) display 'OK'.green - restart appname if app[:state] == 'STARTED' + restart appname if app[:state] == 'STARTED' unless no_restart end def environment_del(appname, variable) @@ -457,7 +458,7 @@ def environment_del(appname, variable) app[:env] = env client.update_app(appname, app) display 'OK'.green - restart appname if app[:state] == 'STARTED' + restart appname if app[:state] == 'STARTED' unless no_restart else display 'OK'.green end diff --git a/lib/cli/runner.rb b/lib/cli/runner.rb index 0c50e42..2257801 100644 --- a/lib/cli/runner.rb +++ b/lib/cli/runner.rb @@ -42,6 +42,8 @@ def parse_options! opts.on('--path PATH') { |path| @options[:path] = path } opts.on('--no-start') { @options[:nostart] = true } opts.on('--nostart') { @options[:nostart] = true } + opts.on('--no-restart') { @options[:norestart] = true } + opts.on('--norestart') { @options[:norestart] = true } opts.on('--force') { @options[:force] = true } opts.on('--all') { @options[:all] = true }