exe/mkdklet in dklet-0.1.1 vs exe/mkdklet in dklet-0.1.2
- old
+ new
@@ -1,16 +1,19 @@
#!/usr/bin/env ruby
-require 'dklet'
rbfile = ARGV[0]
abort "rbfile required!" if rbfile.nil?
rpath = Pathname(rbfile)
abort "rbfile #{rpath.to_s} existed!" if rpath.exist?
rpath.parent.mkpath
extra = ARGV[1..-1].join(' ')
+lib_path = File.join(__dir__, '../lib')
+$:.unshift lib_path unless $:.include?(lib_path)
+
+require 'dklet'
handler = File.basename(__FILE__)
tmpl = Dklet.lib_path.join('template/dklet.erb').read
erb = ERB.new(tmpl, nil, '%<>')
result = erb.result(binding)