Sha256: 07f726c1faafe534447b3752eae3918685256817ee3089def48931608cf539fa

Contents?: true

Size: 1.38 KB

Versions: 1

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'fileutils'

def run option = :browser, location = nil
  case option
  when :server
    require 'atome'
    puts "######"
    if location
      `cd ./#{location}/server;rackup --server puma --port 9292  --env production`
    else
      `cd ./server;rackup --server puma --port 9292  --env production`
    end
  else
    # nothing for now
  end

end

case ARGV[0]
when 'create'
  project_name = ARGV[1]
  Dir.mkdir project_name.to_s
  current_path = `pwd`.chomp
  gem_assets_location = File.join(File.dirname(__FILE__), '../vendor/assets/')
  app_builder_helpers = File.join(File.dirname(__FILE__), '../app_builder_helpers')
  target_template_location = "#{current_path}/#{project_name}"
  Dir.entries(gem_assets_location).select do |entry|
    if File.join(entry) && !%w[. ..].include?(entry)
      entry = "#{File.dirname(__FILE__)}/../vendor/assets/#{entry}"
      FileUtils.cp_r entry, target_template_location
    end
  end
  # now run the rake task to build the needed libraries (atome, renderers, etc...)
  `cd #{app_builder_helpers};rake system_builder #{current_path}/#{project_name}`
  run(:server, project_name)
when 'run'
  case ARGV[1]
  when 'android'
  when 'browser'
  when 'freebsd'
  when 'ios'
  when 'linux'
  when 'osx'
  when 'server'
    run(:server)
  when 'windows'
  else
    # type code here
  end
else
  # type code here
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
atome-0.1.00005 exe/atome