Module: Belt::CLI::AppDetection

Instance Method Summary collapse

Instance Method Details

#detect_app_nameObject



6
7
8
9
10
11
12
13
# File 'lib/belt/cli/app_detection.rb', line 6

def detect_app_name
  routes_file = 'infrastructure/routes.tf.rb'
  if File.exist?(routes_file)
    match = File.read(routes_file).match(/namespace :(\w+)/)
    return match[1] if match
  end
  File.basename(Dir.pwd)
end