repo-scripts/rules/Firmwares.php

19 lines
427 B
PHP

<?php
class Firmwares implements IRule
{
public function getMatchingExtensions(): array
{
return ["elf", "hex", "bin", "frmpkg"];
}
public function processFile(string $file)
{
$dest = Config::$dest."/firmware/" . basename($file);
if (file_exists($dest)) @unlink($dest);
echo "Copying to repository...";
echo (copy($file, $dest) ? "OK" : "FAIL") . "\r\n";
}
}