mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-06 03:16:11 +02:00
Touch an empty file if note doesn't exist.
This commit is contained in:
parent
acb1c17fc1
commit
b8ca05a16c
@ -13,7 +13,7 @@ class Fluentd
|
||||
|
||||
def initialize(file_path, note = nil)
|
||||
@file_path = file_path
|
||||
@note = note || Note.new(file_path.sub(/#{FILE_EXTENSION}$/, Note::FILE_EXTENSION))
|
||||
@note = note || Note.create(file_path.sub(/#{FILE_EXTENSION}$/, Note::FILE_EXTENSION))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -9,6 +9,11 @@ class Fluentd
|
||||
new(file_path_of(backup_dir, file_id))
|
||||
end
|
||||
|
||||
def self.create(file_path)
|
||||
FileUtils.touch(file_path)
|
||||
new(file_path)
|
||||
end
|
||||
|
||||
def initialize(file_path)
|
||||
@file_path = file_path
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user