Class: OceanKit::Config

Inherits:
Thor
  • Object
show all
Defined in:
lib/ocean_kit/resources/config.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ocean_kit/resources/config.rb', line 6

def setup
  # First create the ~/.ocean_kit directory if it doesn't exist
  Dir.mkdir(File.expand_path("~/.ocean_kit")) unless File.directory?(File.expand_path("~/.ocean_kit"))
  # Next create the credentials.yml file if it doesn't exist
  unless File.file?(File.expand_path("~/.ocean_kit/credentials.yml"))
    File.write(File.expand_path("~/.ocean_kit/credentials.yml"), "      ---\n      digital_ocean_token: <YOUR_DIGITAL_OCEAN_TOKEN>\n\n    YAML\n  end\n  puts pastel.green.bold(\"Successfully setup OceanKit environment.\")\n  puts pastel.white.bold(\"Please add your Digital Ocean personal access token your credentials in ~/.ocean_kit/credentials.yml\") if access_token.nil?\nend\n")