misuzu/tools/nuke-tpl-cache

17 lines
433 B
PHP
Executable file

#!/usr/bin/env php
<?php
namespace Misuzu;
require_once __DIR__ . '/../misuzu.php';
$path = $msz->tplCtx->cachePath;
if(empty($path))
die(sprintf('No cache path is specified.%s', PHP_EOL));
if(!is_dir($path))
die(sprintf('Cache directory does not exist.%s', PHP_EOL));
if(fileowner($path) !== posix_getuid())
die(sprintf('Script must be run as the owner of the cache directory.%s', PHP_EOL));
echo `rm -rv {$path}`;