File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,12 @@ newaction {
2727 correct_checksum = correct_checksum :gsub (" [%s%c]" , " " )
2828
2929 -- Check md5
30- local archive_path = CEF_PATH .. " temp.tar.bz2"
30+ local archive_path = CEF_PATH .. " temp.tar.bz2"
3131 if os .md5_file (archive_path ) == correct_checksum then
3232 print (" CEF is already up-to-date" )
3333 return
3434 end
35-
35+
3636 -- Download CEF
3737 print (" Downloading CEF..." )
3838 http .download (CEF_URL , archive_path )
@@ -49,9 +49,10 @@ newaction {
4949 -- Extract first bz2 and then tar
5050 os .extract_archive (archive_path , CEF_PATH , true ) -- Extract .tar.bz2 to .tar
5151 os .extract_archive (CEF_PATH .. " temp.tar" , CEF_PATH , true ) -- Extract .tar
52- os .executef (" {MOVE} %scef_binary*/* %s" , CEF_PATH , CEF_PATH )
53- os .remove_wildcard (CEF_PATH .. " cef_binary*" )
54-
52+
53+ -- Move all files from cef_binary*/* to ./
54+ os .expanddir_wildcard (CEF_PATH .. " cef_binary*" , CEF_PATH )
55+
5556 -- Delete .tar archive, but keep .tar.bz2 for checksumming
5657 os.remove (CEF_PATH .. " temp.tar" )
5758 end
Original file line number Diff line number Diff line change @@ -62,11 +62,21 @@ function os.remove_wildcard(path)
6262 os .rmdir (path )
6363 end
6464 end
65+ end
66+
67+ function os .expanddir_wildcard (from , to )
68+ local dir = os .matchdirs (from )[1 ]
69+ if not dir then return end
70+
71+ -- TODO: Optimize this
72+ os .copydir (dir , to )
73+ os .rmdir (dir )
6574end
6675
6776function os .md5_file (path )
6877 if os .get () == " windows" then
69- return os .outputof (string.format (" call \" utils\\ MD5.exe\" \" %s\" " , path ))
78+ local s = os .outputof (string.format (" CertUtil -hashfile \" %s\" MD5" , path ))
79+ return (s :match (" \n (.*)\n (.*)" ) or " " ):gsub (" " , " " )
7080 else
7181 return os .outputof (string.format (" md5sum \" %s\" | awk '{ print $1 }'" , path ))
7282 end
You can’t perform that action at this time.
0 commit comments