lib/uffizzi/cli/project.rb in uffizzi-cli-0.14.0 vs lib/uffizzi/cli/project.rb in uffizzi-cli-1.0.0
- old
+ new
@@ -100,16 +100,17 @@
name = options[:name]
slug = options[:slug].empty? ? Uffizzi::ProjectHelper.generate_slug(name) : options[:slug]
raise Uffizzi::Error.new('Slug must not content spaces or special characters') unless slug.match?(/^[a-zA-Z0-9\-_]+\Z/i)
server = ConfigFile.read_option(:server)
+ account_id = ConfigFile.read_option(:account_id)
params = {
name: name,
description: options[:description],
slug: slug,
}
- response = create_project(server, params)
+ response = create_project(server, account_id, params)
if ResponseHelper.created?(response)
handle_create_success_response(response)
else
ResponseHelper.handle_failed_response(response)
@@ -163,8 +164,9 @@
Uffizzi.ui.say(projects_list)
end
def set_default_project(project)
ConfigFile.write_option(:project, project[:slug])
+ ConfigFile.write_option(:account_id, project[:account_id])
end
end
end