Sha256: 85afb7e6471cc2ed97b7765e12dd781d12aa8b99db798d0ced69c0e8709f79f8

Contents?: true

Size: 1.24 KB

Versions: 4

Compression:

Stored size: 1.24 KB

Contents

#!/usr/bin/env ruby

LIB_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
VENDOR_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "vendor"))
ASSETS_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "assets"))
APP_NAME= File.basename($0)

$:.unshift(LIB_DIR)

require "distil"

arg_settings= {}
project_file= nil
args= []

ARGV.each { |v|
  if (!v[/^-/])
    args << v
    next
  end
  
  v= v.gsub(/^-+/, '')
  
  key,value= v.split("=")
  key.gsub!("-", "_")
  
  value=true if !value
  
  if ("f"==key || "file"==key || "buildfile"==key)
    project_file= value
    next
  end
  
  arg_settings[key]= value
}

def find_project_file(dir=nil)
  dir ||= Dir.pwd
  
  while dir.length > 1
    Dir.glob(File.join(dir, '*.jsproj')) { |file|
      return file if File.basename(dir)===File.basename(file, '.jsproj')
    }
    dir = File.dirname(dir)
  end
  
end

  
# Change working directory to the folder containing the build YML file.
project_file||= find_project_file

if !project_file
  puts "#{APP_NAME}: can't find project file"
  exit
end

Dir.chdir(File.dirname(project_file))

project= Distil::DistilProject.new(project_file, arg_settings)

if 0==args.length
  args << "build"
end

args.each { |cmd|
  project.send cmd
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
distil-0.12.3 bin/distil
distil-0.12.2 bin/distil
distil-0.12.1 bin/distil
distil-0.12.0 bin/distil