list.json 생성 코드 추가

This commit is contained in:
Hide_D committed 2018-06-15 00:28:51 +09:00
1 parent 2eab567919
commit 55608cae4f
1 file changed
+15 -1
+15 -1
View File
@@ -12,4 +12,18 @@ if($valid_hmac != $req_hmac){
die(''); die('');
} }
exec("git pull -q 2>&1", $output); exec("git pull -q 2>&1", $output);
exec("git ls-files -z ../icons", $raw_img_list);
$raw_img_list = explode("\x00", $raw_img_list[0]);
$img_list = [];
foreach ($raw_img_list as $path) {
$pos = strpos($path, '../icons/');
if($pos === false){
continue;
}
$path = substr($path, $pos + 9);
$img_list[] = $path;
}
file_put_contents('list.json', json_encode($img_list,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));