Skip to content

Commit a2765a0

Browse files
committed
Continue cef setup if no cef dir exists
1 parent 81893e5 commit a2765a0

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

utils/buildactions/install_cef.lua

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,26 +97,24 @@ newaction {
9797
return
9898
end
9999

100-
if not os.isdir(CEF_PATH) then
101-
if not os.mkdir(CEF_PATH) then
102-
errormsg("ERROR: Could not create cef folder")
103-
os.exit(1)
104-
return
105-
end
106-
end
100+
local has_cef_dir = os.isdir(CEF_PATH)
107101

108102
-- Check file hash
109103
local archive_path = CEF_TEMP_PATH.."temp.tar.bz2"
110-
if os.isfile(archive_path) and os.sha256_file(archive_path) == CEF_HASH then
104+
local hash_passed = os.isfile(archive_path) and os.sha256_file(archive_path) == CEF_HASH
105+
if hash_passed then
111106
print("CEF consistency checks succeeded")
112-
return
113-
end
114107

115-
-- Download CEF
116-
print("Downloading CEF " .. CEF_VERSION .. "...")
117-
if not http.download_print_errors(make_cef_download_url(), archive_path) then
118-
os.exit(1)
119-
return
108+
if has_cef_dir then
109+
return
110+
end
111+
else
112+
-- Download CEF
113+
print("Downloading CEF " .. CEF_VERSION .. "...")
114+
if not http.download_print_errors(make_cef_download_url(), archive_path) then
115+
os.exit(1)
116+
return
117+
end
120118
end
121119

122120
local downloaded_hash = os.sha256_file(archive_path)
@@ -145,7 +143,7 @@ newaction {
145143
end
146144

147145
-- Delete old CEF files
148-
if os.isdir(CEF_PATH) then
146+
if has_cef_dir then
149147
if not os.rmdir(CEF_PATH) then
150148
errormsg("ERROR: Could not delete cef folder")
151149
os.exit(1)

0 commit comments

Comments
 (0)