Sha256: 50a99deae149ebc83abadd0b819d5f5a4145c8ead97d63bbe5c07c79b855eeaf

Contents?: true

Size: 1.87 KB

Versions: 4

Compression:

Stored size: 1.87 KB

Contents

#!/usr/bin/env ruby
require "souls"

begin
  begin
    require "./config/initializers/souls" unless ARGV[0] == "new"
  rescue
    Souls::Init.config_init
  end
  case ARGV[0]
  when "new"
    if ARGV[1].nil?
      puts "you need to specify your app name \n `souls new app_name`"
      exit
    end
    puts "Which framework:   \n 1. SOULS gRPC Service \n 2. SOULS GraphQL API gRPC compatible \n 3. SOULS GraphQL API \n 4. SOULS Media Web \n 5. SOULS Admin Web \n Enter Number: "
    strain = STDIN.gets.chomp.to_i
    (1..5).include?(strain) ? puts("Generating Souls.. \n") : raise(StandardError, "Choose Number 1..5")
    Souls::Init.create_souls strain: strain, app_name: ARGV[1]
  when "s", "server"
    strain = Souls.configuration.strain
    case strain
    when "api"
      system "bundle exec puma -p 3000"
    when "service"
      system "bundle exec rake run_server"
    else
      system "yarn dev"
    end
  when "c", "console"
    strain = Souls.configuration.strain
    case strain
    when "api"
      system "bundle exec irb"
    when "service"
      system "bundle exec irb"
    else
      system "yarn dev"
    end
  when "i", "infra"
    Souls.send ARGV[1]
  when "p", "proto"
    Souls::Init.proto proto_package_name: "souls", service: ARGV[1]
  when "init"
    Souls::Init.config_init
  when "-v", "--version"
    puts Souls::VERSION
  when "g", "generate"
    `touch .rubocop.yml`
    `touch .env`
    `touch .gitignore`
    `touch .irbrc`
  when "t", "test"
    case ARGV[1]
    when "-r"
      `bundle exec rspec`
    when "-s"
      `bundle exec steep check`
    else
      `bundle exec steep check`
      `bundle exec rspec`
    end
  when "deploy"
    project_id = Souls.configuration.project_id
    `gcloud builds submit --config=cloudbuild.yml --project #{project_id}`
  else
    puts "Welcome to Souls!Yeah!"
  end
rescue StandardError => error
  puts error
  puts "Thank you!Souls!"
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
souls-0.8.4 exe/souls
souls-0.8.3 exe/souls
souls-0.8.2 exe/souls
souls-0.8.1 exe/souls