Skip to content

Commit

Permalink
🍒 完善升级模块
Browse files Browse the repository at this point in the history
  • Loading branch information
metowolf committed Mar 8, 2018
1 parent b66f1b0 commit 0776242
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,8 @@ private function update()

foreach ($shasum as $remote) {
list($remote_sha256, $filename) = explode(' ', $remote);
if (!file_exists(__DIR__.'/'.$filename)) {
continue;
}
$local_sha256 = hash('sha256', file_get_contents(__DIR__.'/'.$filename));
if (!hash_equals($local_sha256, $remote_sha256)) {
if (!file_exists(__DIR__.'/'.$filename) ||
!hash_equals(hash('sha256', file_get_contents(__DIR__.'/'.$filename)), $remote_sha256)) {
echo "下载 ".$filename;
$url = 'https://raw.githubusercontent.com/MoePlayer/APlayer-Typecho/master'.substr($filename, 1);

Expand Down
2 changes: 1 addition & 1 deletion shasum.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0ee891ceb5f6a8d4cd94ef256abd7887f2e08ff90eed087a5553b70575cbe69d ./Action.php
437cbad1f79ae3fa930c35e5ba6a194ed77cce1cb35a3560af0c7279d33fdbd1 ./Action.php
aa3c0deef2f5b5524f9e7cbd1809d14d51e0a5eae8f21e183483c84c28b86e46 ./assets/APlayer.min.js
6c1db3ae0b983df3e9395aa133875e64c7cb6321064c982d507fa7d82f7258f3 ./assets/editer.js
efd4f31c32ad090a109c0fb30a04c007093aa3d304e26adcc2cb75153812ecb1 ./assets/Meting.min.js
Expand Down

0 comments on commit 0776242

Please # to comment.