From 44ef37ef354000cfce388d8c45cd8871bf2e70e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Fri, 7 Dec 2018 17:07:51 +0100 Subject: [PATCH] Fail if no svgexport MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- build/generateIconsDoc.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build/generateIconsDoc.php b/build/generateIconsDoc.php index 1b2adfebd..611926819 100755 --- a/build/generateIconsDoc.php +++ b/build/generateIconsDoc.php @@ -26,6 +26,17 @@ include __DIR__ . '/vendor/autoload.php'; use Leafo\ScssPhp\Compiler; use Leafo\ScssPhp\Formatter\Crunched; +function command_exist($cmd) { + $return = shell_exec(sprintf("which %s", escapeshellarg($cmd))); + return !empty($return); +} + +// You need svgexport to run this script +if (!command_exist('svgexport')) { + print("\n\nYou need svgexport to run this script. Please install it with `npm install svgexport -g`\n\n"); + exit(1); +} + $sourceDirectory = __DIR__ . '/server'; $destinationDirectory = __DIR__ . '/../developer_manual/design/';