Changeset View
Changeset View
Standalone View
Standalone View
support/lib/rebuild-map.php
#!/usr/bin/env php | #!/usr/bin/env php | ||||
<?php | <?php | ||||
$root = dirname(dirname(dirname(__FILE__))); | $root = dirname(dirname(__DIR__)); | ||||
require_once $root.'/support/init/init-script.php'; | require_once $root.'/support/init/init-script.php'; | ||||
$args = new PhutilArgumentParser($argv); | $args = new PhutilArgumentParser($argv); | ||||
$args->setTagline(pht('rebuild the library map file')); | $args->setTagline(pht('rebuild the library map file')); | ||||
$args->setSynopsis(<<<EOHELP | $args->setSynopsis(<<<EOHELP | ||||
**rebuild-map.php** [__options__] __root__ | **rebuild-map.php** [__options__] __root__ | ||||
Rebuild the library map file for a libphutil library. | Rebuild the library map file for a libphutil library. | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
if ($args->getArg('show')) { | if ($args->getArg('show')) { | ||||
$library_map = $builder->buildMap(); | $library_map = $builder->buildMap(); | ||||
if ($args->getArg('ugly')) { | if ($args->getArg('ugly')) { | ||||
echo json_encode($library_map); | echo json_encode($library_map); | ||||
} else { | } else { | ||||
echo id(new PhutilJSON())->encodeFormatted($library_map); | echo (new PhutilJSON())->encodeFormatted($library_map); | ||||
} | } | ||||
} else { | } else { | ||||
$builder->buildAndWriteMap(); | $builder->buildAndWriteMap(); | ||||
} | } | ||||
exit(0); | exit(0); |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0