File tree Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Expand file tree Collapse file tree 1 file changed +14
-16
lines changed Original file line number Diff line number Diff line change @@ -97,26 +97,24 @@ newaction {
97
97
return
98
98
end
99
99
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 )
107
101
108
102
-- Check file hash
109
103
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
111
106
print (" CEF consistency checks succeeded" )
112
- return
113
- end
114
107
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
120
118
end
121
119
122
120
local downloaded_hash = os .sha256_file (archive_path )
@@ -145,7 +143,7 @@ newaction {
145
143
end
146
144
147
145
-- Delete old CEF files
148
- if os . isdir ( CEF_PATH ) then
146
+ if has_cef_dir then
149
147
if not os .rmdir (CEF_PATH ) then
150
148
errormsg (" ERROR: Could not delete cef folder" )
151
149
os.exit (1 )
You can’t perform that action at this time.
0 commit comments