From 55608cae4ff0060c6933482c44ce84be9bae4899 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 15 Jun 2018 00:28:51 +0900 Subject: [PATCH] =?UTF-8?q?list.json=20=EC=83=9D=EC=84=B1=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hook/hook.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hook/hook.php b/hook/hook.php index 9d7e2c3..6eda360 100644 --- a/hook/hook.php +++ b/hook/hook.php @@ -12,4 +12,18 @@ if($valid_hmac != $req_hmac){ die(''); } -exec("git pull -q 2>&1", $output); \ No newline at end of file +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)); \ No newline at end of file