From 2dc52153902f0cb7e1bfcd6ff3aa2a091fd136ca Mon Sep 17 00:00:00 2001 From: Apeiros-46B Date: Fri, 8 Jul 2022 16:45:37 -0700 Subject: [PATCH] Simplify if statement --- helpers/filesystem.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/helpers/filesystem.lua b/helpers/filesystem.lua index 9a567bd..38d9157 100644 --- a/helpers/filesystem.lua +++ b/helpers/filesystem.lua @@ -53,11 +53,9 @@ function _filesystem.list_directory_files(path, exts, recursive) end function _filesystem.save_image_async_curl(redownload, create_dirs, url, filepath, callback) - if not redownload then - if Gio.File.query_exists(Gio.File.new_for_path(filepath)) then - callback() - return - end + if not redownload and Gio.File.query_exists(Gio.File.new_for_path(filepath)) then + callback() + return end awful.spawn.with_line_callback(string.format("curl -L -s %s -o %s %s", url, filepath, (create_dirs and "--create-dirs" or "")),