diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-04-28 14:33:14 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-04-28 14:33:14 +0200 |
commit | 6da54c7566c8b4edd3858f63291400d0f4a61134 (patch) | |
tree | 5206d9ed6fcdd2d032ab1da7a981b1e38173459e /skeletons.rb | |
parent | 020b783b02ed7e31f4b96cda856b1e0d29b6b355 (diff) | |
download | vim-6da54c7566c8b4edd3858f63291400d0f4a61134.zip vim-6da54c7566c8b4edd3858f63291400d0f4a61134.tar.gz |
support having no LICENSE env var
Diffstat (limited to 'skeletons.rb')
-rwxr-xr-x | skeletons.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/skeletons.rb b/skeletons.rb index f88ae49..55c31aa 100755 --- a/skeletons.rb +++ b/skeletons.rb @@ -24,14 +24,14 @@ exit if skeleton.nil? @website = ENV['WEBSITE'] || 'http://john.doe.org' @now = Date.today.strftime("%d/%m/%y") @year = Date.today.strftime("%Y") -@license_file = ENV['LICENSE'] +@license_file = ENV['LICENSE'] || nil @filename = filename @filename_base = filename.split('.')[0] @class_name = filename.split('.')[0].capitalize @project = File.split( File.dirname( filepath ) ).last def license comment=nil - return unless File.exist? @license_file + return unless @license_file and File.exist? @license_file return File.new( @license_file ).read if comment.nil? license = '' File.new( @license_file ).each_line { |l| license+=comment+l } |