Sha256: 219024812c986c6eb0d0e0008793b19dbe3ad32e44e7e8ef0fee2ee95b176da3

Contents?: true

Size: 780 Bytes

Versions: 6

Compression:

Stored size: 780 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 = { '.' => ['docker-compose.yml', '.tmuxinator.yml',
                            { '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)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
neptuno-1.0.6 lib/neptuno/cli/init.rb
neptuno-1.0.5 lib/neptuno/cli/init.rb
neptuno-1.0.3 lib/neptuno/cli/init.rb
neptuno-1.0.2 lib/neptuno/cli/init.rb
neptuno-1.0.1 lib/neptuno/cli/init.rb
neptuno-1.0.0 lib/neptuno/cli/init.rb