From d81e9d40bd51c418e695cc936eef449ed184c14a Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 6 May 2020 13:54:09 +0800 Subject: [PATCH] fix error --- announcement.gemspec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/announcement.gemspec b/announcement.gemspec index c65abf0..b2e32c0 100644 --- a/announcement.gemspec +++ b/announcement.gemspec @@ -38,7 +38,7 @@ all_template.each do |folder| i = texts.rindex(s1[-1]) texts[i] = "" end - regex_pattern = /.response-content {\n justify-self: auto;\n}|.response-content {\n position: static;\n}|.response-content {\n position: relative;\n}|.response-content[^{]*{[^}]*@media[^{]*{[^{]*}[^{]*@media[^{]*{[^{]*}[^}]*}[^}]*}/m + regex_pattern = /.response-content {\n justify-self: auto;\n}|.response-content {\n position: static;\n}|.response-content {\n position: relative;\n}/m #|.response-content[^{]*{[^}]*@media[^{]*{[^{]*}[^{]*@media[^{]*{[^{]*}[^}]*}[^}]*} if !texts.include? "$font-h1:" texts = "$font-h1: 1.5rem;\n$font-h2: 1.35rem;\n$font-h3: 1.2rem;\n$font-h4: 1.1rem;\n$font-h5: 1rem;\n$font-h6: 0.9rem;\n\n" + texts end @@ -77,8 +77,9 @@ 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" + texts = texts + check_text File.open(filename, 'w') do |file| - file.write(texts + check_text) + file.write(texts) end end end