Sha256: 4e38b194f15b17be0f12a8afe6beb34e325eaa8d576bf2e053b2b89066889cd1
Contents?: true
Size: 819 Bytes
Versions: 16
Compression:
Stored size: 819 Bytes
Contents
require 'sct_core/ui/ui' require 'sct_core/config' module Sct class InitCommand def execute(args, options) dir = SctCore::Config.dir cli = HighLine.new email = cli.ask("What is your email address?") { |q| q.validate = URI::MailTo::EMAIL_REGEXP } cloud_proxy_path = cli.ask("What is the path of your cloud proxy json credentials?") { |q| q.default = "~/.config/gcloud/application_default_credentials.json" } contents = "" contents << "email=#{email}\n" contents << "cloud-proxy-path=#{File.expand_path(cloud_proxy_path)}\n" if !File.directory?(dir) FileUtils.mkdir_p(dir) end File.write(SctCore::Config.path, contents) puts "Generated config file at #{SctCore::Config.path}" end end end
Version data entries
16 entries across 16 versions & 1 rubygems