Update ruby scripts to use 'File.exist?'
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
parent
06e8b8e022
commit
b07ea85b70
2
agda.rb
2
agda.rb
@ -23,7 +23,7 @@ class AgdaContext
|
|||||||
return @file_infos[file] if @file_infos.include? file
|
return @file_infos[file] if @file_infos.include? file
|
||||||
|
|
||||||
@file_infos[file] = line_infos = {}
|
@file_infos[file] = line_infos = {}
|
||||||
unless File.exists?(file)
|
unless File.exist?(file)
|
||||||
return line_infos
|
return line_infos
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ files.each do |file|
|
|||||||
tags = []
|
tags = []
|
||||||
group = 1
|
group = 1
|
||||||
draft = false
|
draft = false
|
||||||
next unless File.exists?(file)
|
next unless File.exist?(file)
|
||||||
value = File.size(file)
|
value = File.size(file)
|
||||||
url = file.gsub(/^content/, "https://danilafe.com").delete_suffix("/index.md").delete_suffix(".md")
|
url = file.gsub(/^content/, "https://danilafe.com").delete_suffix("/index.md").delete_suffix(".md")
|
||||||
File.readlines(file).each do |l|
|
File.readlines(file).each do |l|
|
||||||
|
@ -26,7 +26,7 @@ files = ARGV
|
|||||||
code_paths = Dir.entries(root_path).select do |f|
|
code_paths = Dir.entries(root_path).select do |f|
|
||||||
File.directory?(File.join(root_path, f)) and f != '.' and f != '..'
|
File.directory?(File.join(root_path, f)) and f != '.' and f != '..'
|
||||||
end.to_set
|
end.to_set
|
||||||
code_paths += JSON.parse(File.read(data_file)).keys if File.exists? data_file
|
code_paths += JSON.parse(File.read(data_file)).keys if File.exist? data_file
|
||||||
# Extending code_paths from submodules.json means that nested Agda modules
|
# Extending code_paths from submodules.json means that nested Agda modules
|
||||||
# have their root dir correctly set.
|
# have their root dir correctly set.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user