repo-scripts/rules/LinuxArchives.php

22 lines
549 B
PHP

<?php
class LinuxArchives implements IRule
{
public function getMatchingExtensions(): array
{
return ["tar", "gz", "tgz", "gzip", "bz2", "bzip2", "tbz2", "tb2", "tbz", "z", "taz", "lzma", "xz", "txz", "lzo", "tzo", "lz", "tlz", "zst", "tzst"];
}
public function processFile(string $file)
{
$dest = Config::$dest."/linux/general/" . basename($file);
if (file_exists($dest)) @unlink($dest);
echo "Copying to repository...";
echo (copy($file, $dest) ? "OK" : "FAIL") . "\r\n";
}
}