repo-scripts/rules/WindowsExecutables.php

21 lines
441 B
PHP

<?php
class WindowsExecutables implements IRule
{
public function getMatchingExtensions(): array
{
return ["exe", "cmd", "bat", "msi", "zip"];
}
public function processFile(string $file)
{
$dest = Config::$dest."/windows/" . basename($file);
if (file_exists($dest)) @unlink($dest);
echo "Copying to repository...";
echo (copy($file, $dest) ? "OK" : "FAIL") . "\r\n";
}
}