aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-10-07 19:18:20 +0530
committersinanmohd <sinan@sinanmohd.com>2023-10-07 19:18:20 +0530
commit5f5adabdeec7f2bf0897ef81fbc7e04dfed4b015 (patch)
treef408219d5ba3b46ba29efadea158405f76357be8 /lib
parent048496da427917056c3331e3482590e59955b685 (diff)
lib/util: init file_exists
Diffstat (limited to 'lib')
-rw-r--r--lib/util.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/util.lua b/lib/util.lua
index a4d3034..d52922d 100644
--- a/lib/util.lua
+++ b/lib/util.lua
@@ -11,6 +11,10 @@ local table_to_cmd = function (t)
return str
end
+local file_exists = function (path)
+ return io.open(path, 'r') and true or false
+end
+
local run = function (args)
local sig, rc, stdout, cmd
@@ -185,6 +189,7 @@ return {
zip_ext_first = zip_ext_first,
string_vid_path_to_name = string_vid_path_to_name,
opensubtitles_hash = opensubtitles_hash,
+ file_exists = file_exists,
run = run,
error = error,
}