Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e961eba

Browse filesBrowse files
committed
Create mapping file if not exists
1 parent b7f913c commit e961eba
Copy full SHA for e961eba

File tree

1 file changed

+6
-0
lines changed
Filter options

1 file changed

+6
-0
lines changed

‎lib/qiita.rb

Copy file name to clipboardExpand all lines: lib/qiita.rb
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def initialize(content:, header:, mode:, path:)
1616
@header = header
1717
@mode = mode
1818
@path = path
19+
20+
create_mapping_file_if_not_exists
1921
end
2022

2123
# Publish an article to Qiita
@@ -113,4 +115,8 @@ def mappings
113115
file.read.split("\n")
114116
end
115117
end
118+
119+
def create_mapping_file_if_not_exists
120+
File.new(ENV['MAPPING_FILEPATH'], 'a') if File.exist?(ENV['MAPPING_FILEPATH'])
121+
end
116122
end

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.