Sha256: 87bde5e44ea5b8296714f6699e6ca52049165ede553a45f42c8880f8d0a4027f

Contents?: true

Size: 1.54 KB

Versions: 15

Compression:

Stored size: 1.54 KB

Contents

#!/usr/bin/env ruby
module Distil
  
  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)

end

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

  immediate_projects= Dir.glob(File.join(dir, "*.jsproj"))
  if (!immediate_projects.empty? && 1==immediate_projects.length)
    return immediate_projects[0]
  end
  
  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 "#{Distil::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
  exit 1 if project.total_error_count > 0
  exit 1 if project.warnings_are_errors && project.total_warning_count > 0
}

Version data entries

15 entries across 10 versions & 1 rubygems

Version Path
distil-0.14.0.d bin/distil-old
distil-0.14.0.c bin/distil-old
distil-0.14.0.b bin/distil-old
distil-0.13.6 bin/distil-old
distil-0.13.6 bin/distil
distil-0.13.5 bin/distil-old
distil-0.13.5 bin/distil
distil-0.13.4 bin/distil-old
distil-0.13.4 bin/distil
distil-0.13.3 bin/distil-old
distil-0.13.3 bin/distil
distil-0.13.2 bin/distil-old
distil-0.13.2 bin/distil
distil-0.13.1 bin/distil
distil-0.13.0 bin/distil