Example #1
0
        init();
        exit;
    } else {
        if (!isset($argv[2])) {
            e('miss 2 parameter ', 'red');
        }
    }
}
$source = realpath($argv[2]);
$_cf = loadConf(UC_LOC);
$now_dir = isset($argv[2]) ? $source : getenv('PWD');
define_proj_dir($_cf['git_dir'], $_cf['user'], $now_dir);
//loading config
conf_to_def($_cf);
if (is_file(PCONF_LOC)) {
    $_pcf = loadConf(PCONF_LOC);
} else {
    proj_setting($_cf);
}
check_version();
if ($argv[1] == '-all') {
    proj_all();
} else {
    if ($argv[1] == '-file') {
        $file = is_file($argv[2]) ? $argv[2] : e('file not exist', 'red');
        proj_file($file);
    } else {
        if ($argv[1] == '-build') {
            $file = $argv[2];
            $info = pathinfo($file);
            if ($info['extension'] == 'icf' && is_file($file)) {
Example #2
0
            }
            // Explicit requires
            if (in_array($n, $pack['requires'])) {
                // Implicit requires
                if (in_array($n, $req)) {
                    if ($first) {
                        $first = false;
                        echo $pack['name'] . "\n";
                    }
                    echo "\t- {$n} optional and implicitly required\n";
                }
                $req = getRequires($n, $req);
                // Not explicit
            } else {
                // Not implicit
                if (!in_array($n, $req) && !in_array($n, $conf['missing']) && !(isset($conf['ignore'][$pack['name']]) && in_array($n, $conf['ignore'][$pack['name']]))) {
                    if ($first) {
                        $first = false;
                        echo $pack['name'] . "\n";
                    }
                    echo "\t+ {$n}  optional, missing\n";
                }
            }
        }
    }
}
$verb = in_array('-v', $_SERVER['argv']);
$conf = loadConf($verb);
loadFiles($verb);
showBuildOrder($verb);
scanOptional($verb);
Example #3
0
define('UC_LOC', getenv('HOME') . '/.beeconf');
// user config file name
function loadConf($conf)
{
    if (file_exists($conf)) {
        $content = json_decode(file_get_contents($conf), true);
        if (empty($content)) {
            e($conf . '.beeconf format wrong ', 'red');
        }
        return $content;
    } else {
        return false;
    }
}
$_cf = loadConf(UC_LOC);
if ($_cf == false || !isset($argv[1])) {
    echo getenv("PWD");
    exit;
} else {
    $git_dir = $_cf['git_dir'];
    $now_dir = $argv[1];
    $len = strlen($git_dir);
    $left_dir = substr($now_dir, $len + 1);
    $raw = explode("/", $left_dir);
    if (strpos($now_dir, $git_dir) === false or count($raw) < 1 or $raw[0] == '') {
        echo $git_dir;
    } else {
        echo $git_dir . '/' . $raw[0];
    }
}