Sha256: 2c60a6d88083e6a91af84a1ee84153167a3c11cbb0c462762e000b89bf302b0a

Contents?: true

Size: 777 Bytes

Versions: 1

Compression:

Stored size: 777 Bytes

Contents

# frozen_string_literal: true

module Neptuno
  module CLI
    # Init Neptuno files
    class Init < Dry::CLI::Command
      include TTY::File
      include TTY::Config
      include TTY::Which

      desc 'Initializes a Neptuno project folder structure'

      WORK_TREE = { '.' => [{ 'services' => [], 'dockerfiles' => [], 'procfiles' => [], 'environments' => [] }] }.freeze

      CONFIG = nil

      def call(**)
        abort 'Neptuno projects can not be nested.' if neptuno_path != ''
        ::TTY::File.create_dir(WORK_TREE, Dir.pwd)
        config.set(:configured_services, value: '')
        config.set(:services, value: [])
        config.write(create: true, force: true)
        `cp -r #{File.expand_path('../templates', __dir__)}/* ./`
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neptuno-1.4.10 lib/neptuno/cli/init.rb