From 6da54c7566c8b4edd3858f63291400d0f4a61134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 28 Apr 2014 14:33:14 +0200 Subject: support having no LICENSE env var --- skeletons.rb | 4 ++-- 1 file 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 } -- cgit v1.1-2-g2b99