From 8b05282dbe71c0075cc5fc060dc3da754bd2c951 Mon Sep 17 00:00:00 2001 From: chiu Date: Sun, 8 Mar 2020 14:52:29 +0800 Subject: [PATCH] fix adding text error occur on sometimes that will overwrite the whole file --- announcement.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/announcement.gemspec b/announcement.gemspec index edd7bd7..375134f 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -76,8 +76,8 @@ all_template.each do |folder| check_texts.each do |check_text| if !texts.include?(check_text) puts "editing #{folder}assets/stylesheets/template/base/_variables.scss" - File.open(filename, 'a') do |file| - file.puts check_text + File.open(filename, 'w') do |file| + file.write(texts + check_text) end end end