<?php

function canRemove($dirId, $newRelease)
{
    return $newRelease != $dirId;
}

foreach (glob(dirname(__DIR__) . '/*') as $path) {
    if (is_dir($path)) {
        $dirName = pathinfo($path, PATHINFO_BASENAME);
        if (is_numeric($dirName) && canRemove($dirName, $argv[1])) {
            system("rm -rf $path");
        }
    }
}
