Sha256: 66092cfee440450f35979705b85649286440e5b7d201a8404abe700ad08367fd

Contents?: true

Size: 823 Bytes

Versions: 1

Compression:

Stored size: 823 Bytes

Contents

#!/usr/bin/env ruby

require 'flok'
require 'thor'
require 'fileutils'

class FlokCLI < Thor
  desc "new <path>", "Create a new flok project and/or module, you may supply an absolute path or relative, the last entry in the path will be the module name and folder name of the project"
  def new path
    name = File.basename(path)
    Dir.chdir File.dirname(path) do
      `bundle gem #{name}`

      Dir.chdir name do
        Dir.mkdir "app"
        Dir.mkdir "config"
      end
    end
  end

  desc "build", "Build a flok project, you must be in the root of the project"
  def build
    Dir.mkdir("./public") unless File.exists?("./public")
    FileUtils.touch "./public/application.js"

    kernel_src = Flok::MergeSource.merge_kernel
    File.write("./public/application.js", kernel_src)
  end
end

FlokCLI.start(ARGV)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
flok-0.0.2 bin/flok