'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
<?php
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
final class ArcanistLiberateWorkflow
|
|
|
|
extends ArcanistArcWorkflow {
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
|
Make Arcanist workflow names explicit
Summary:
Currently, adding a new workflow requires you to override ArcanistConfiguration, which is messy. Instead, just load everything that extends ArcanistBaseWorkflow.
Remove all the rules tying workflow names to class names through arcane incantations.
This has a very small performance cost in that we need to load every Workflow class every time now, but we don't hit __init__ and such anymore and it was pretty negligible on my machine (98ms vs 104ms or something).
Test Plan: Ran "arc help", "arc which", "arc diff", etc.
Reviewers: edward, vrana, btrahan
Reviewed By: edward
CC: aran, zeeg
Differential Revision: https://secure.phabricator.com/D3691
2012-10-17 17:35:03 +02:00
|
|
|
public function getWorkflowName() {
|
|
|
|
return 'liberate';
|
|
|
|
}
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
public function getWorkflowInformation() {
|
|
|
|
// TOOLSETS: Expand this help.
|
2012-03-05 19:02:37 +01:00
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
$help = pht(<<<EOTEXT
|
|
|
|
Create or update an Arcanist library.
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
EOTEXT
|
2020-02-13 23:38:36 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
return $this->newWorkflowInformation()
|
|
|
|
->addExample(pht('**liberate**'))
|
|
|
|
->addExample(pht('**liberate** [__path__]'))
|
|
|
|
->setHelp($help);
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
public function getWorkflowArguments() {
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
return array(
|
2020-02-13 23:38:36 +01:00
|
|
|
$this->newWorkflowArgument('clean')
|
|
|
|
->setHelp(
|
|
|
|
pht('Perform a clean rebuild, ignoring caches. Thorough, but slow.')),
|
|
|
|
$this->newWorkflowArgument('argv')
|
|
|
|
->setWildcard(true),
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
public function runWorkflow() {
|
|
|
|
$log = $this->getLogEngine();
|
|
|
|
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
$argv = $this->getArgument('argv');
|
|
|
|
if (count($argv) > 1) {
|
|
|
|
throw new ArcanistUsageException(
|
2015-05-13 10:05:15 +02:00
|
|
|
pht(
|
2020-02-13 23:38:36 +01:00
|
|
|
'Provide only one path to "arc liberate". The path should identify '.
|
|
|
|
'a directory where you want to create or update a library.'));
|
|
|
|
} else if (!$argv) {
|
|
|
|
$log->writeStatus(
|
|
|
|
pht('SCAN'),
|
|
|
|
pht('Searching for libraries in the current working directory...'));
|
|
|
|
|
|
|
|
$init_files = id(new FileFinder(getcwd()))
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
->withPath('*/__phutil_library_init__.php')
|
|
|
|
->find();
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
if (!$init_files) {
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
throw new ArcanistUsageException(
|
2015-05-13 10:05:15 +02:00
|
|
|
pht(
|
2020-02-13 23:38:36 +01:00
|
|
|
'Unable to find any libraries under the current working '.
|
|
|
|
'directory. To create a library, provide a path.'));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
2020-02-13 23:38:36 +01:00
|
|
|
|
|
|
|
$paths = array();
|
|
|
|
foreach ($init_files as $init) {
|
|
|
|
$paths[] = Filesystem::resolvePath(dirname($init));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
2020-02-13 23:38:36 +01:00
|
|
|
} else {
|
|
|
|
$paths = array(
|
|
|
|
Filesystem::resolvePath(head($argv)),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($paths as $path) {
|
|
|
|
$log->writeStatus(
|
|
|
|
pht('WORK'),
|
|
|
|
pht(
|
|
|
|
'Updating library: %s',
|
|
|
|
Filesystem::readablePath($path).DIRECTORY_SEPARATOR));
|
|
|
|
$this->liberatePath($path);
|
|
|
|
}
|
|
|
|
|
|
|
|
$log->writeSuccess(
|
|
|
|
pht('DONE'),
|
|
|
|
pht('Updated %s librarie(s).', phutil_count($paths)));
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function liberatePath($path) {
|
|
|
|
if (!Filesystem::pathExists($path.'/__phutil_library_init__.php')) {
|
|
|
|
echo tsprintf(
|
|
|
|
"%s\n",
|
|
|
|
pht(
|
|
|
|
'No library currently exists at the path "%s"...',
|
|
|
|
$path));
|
|
|
|
$this->liberateCreateDirectory($path);
|
|
|
|
$this->liberateCreateLibrary($path);
|
|
|
|
return;
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
|
2012-05-30 23:18:11 +02:00
|
|
|
$version = $this->getLibraryFormatVersion($path);
|
|
|
|
switch ($version) {
|
|
|
|
case 1:
|
2012-06-26 21:40:42 +02:00
|
|
|
throw new ArcanistUsageException(
|
2015-05-13 10:05:15 +02:00
|
|
|
pht(
|
2020-02-13 23:38:36 +01:00
|
|
|
'This very old library is no longer supported.'));
|
2012-05-30 23:18:11 +02:00
|
|
|
case 2:
|
|
|
|
return $this->liberateVersion2($path);
|
|
|
|
default:
|
|
|
|
throw new ArcanistUsageException(
|
2015-05-13 10:05:15 +02:00
|
|
|
pht("Unknown library version '%s'!", $version));
|
2012-05-30 23:18:11 +02:00
|
|
|
}
|
2020-02-13 17:08:35 +01:00
|
|
|
|
|
|
|
echo tsprintf("%s\n", pht('Done.'));
|
2012-05-30 23:18:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private function getLibraryFormatVersion($path) {
|
|
|
|
$map_file = $path.'/__phutil_library_map__.php';
|
|
|
|
if (!Filesystem::pathExists($map_file)) {
|
|
|
|
// Default to library v1.
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
$map = Filesystem::readFile($map_file);
|
|
|
|
|
|
|
|
$matches = null;
|
|
|
|
if (preg_match('/@phutil-library-version (\d+)/', $map, $matches)) {
|
|
|
|
return (int)$matches[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function liberateVersion2($path) {
|
2020-02-12 23:24:11 +01:00
|
|
|
$bin = $this->getScriptPath('support/lib/rebuild-map.php');
|
|
|
|
|
|
|
|
$argv = array();
|
2020-02-13 23:38:36 +01:00
|
|
|
if ($this->getArgument('clean')) {
|
2020-02-12 23:24:11 +01:00
|
|
|
$argv[] = '--drop-cache';
|
|
|
|
}
|
2012-05-30 23:18:11 +02:00
|
|
|
|
|
|
|
return phutil_passthru(
|
2020-02-13 23:38:36 +01:00
|
|
|
'php -f %R -- %Ls %R',
|
2012-05-30 23:18:11 +02:00
|
|
|
$bin,
|
2020-02-12 23:24:11 +01:00
|
|
|
$argv,
|
2012-05-30 23:18:11 +02:00
|
|
|
$path);
|
|
|
|
}
|
|
|
|
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
private function liberateCreateDirectory($path) {
|
|
|
|
if (Filesystem::pathExists($path)) {
|
|
|
|
if (!is_dir($path)) {
|
|
|
|
throw new ArcanistUsageException(
|
2015-05-13 10:05:15 +02:00
|
|
|
pht(
|
|
|
|
'Provide a directory to create or update a libphutil library in.'));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-13 10:05:15 +02:00
|
|
|
echo pht("The directory '%s' does not exist.", $path);
|
|
|
|
if (!phutil_console_confirm(pht('Do you want to create it?'))) {
|
2020-02-13 23:38:36 +01:00
|
|
|
throw new ArcanistUsageException(pht('Cancelled.'));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
|
2020-02-13 23:38:36 +01:00
|
|
|
execx('mkdir -p %R', $path);
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
private function liberateCreateLibrary($path) {
|
|
|
|
$init_path = $path.'/__phutil_library_init__.php';
|
|
|
|
if (Filesystem::pathExists($init_path)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-13 10:05:15 +02:00
|
|
|
echo pht("Creating new libphutil library in '%s'.", $path)."\n";
|
2013-06-26 00:26:14 +02:00
|
|
|
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
do {
|
2020-02-13 23:38:36 +01:00
|
|
|
echo pht('Choose a name for the new library.')."\n";
|
|
|
|
$name = phutil_console_prompt(
|
|
|
|
pht('What do you want to name this library?'));
|
|
|
|
|
2012-07-26 03:37:25 +02:00
|
|
|
if (preg_match('/^[a-z-]+$/', $name)) {
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
break;
|
|
|
|
} else {
|
2015-05-14 23:09:30 +02:00
|
|
|
echo phutil_console_format(
|
|
|
|
"%s\n",
|
|
|
|
pht(
|
|
|
|
'Library name should contain only lowercase letters and hyphens.'));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
} while (true);
|
|
|
|
|
|
|
|
$template =
|
|
|
|
"<?php\n\n".
|
|
|
|
"phutil_register_library('{$name}', __FILE__);\n";
|
|
|
|
|
2015-05-13 10:05:15 +02:00
|
|
|
echo pht(
|
|
|
|
"Writing '%s' to '%s'...\n",
|
|
|
|
'__phutil_library_init__.php',
|
|
|
|
$path);
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
Filesystem::writeFile($init_path, $template);
|
2012-08-23 00:27:13 +02:00
|
|
|
$this->liberateVersion2($path);
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private function getScriptPath($script) {
|
2020-02-12 23:24:11 +01:00
|
|
|
$root = dirname(phutil_get_library_root('arcanist'));
|
'arc liberate', convenience wrapper for various libphutil operations
Summary:
The story for creating and maintaining libphutil libraries and modules
is pretty terrible right now: you need to know a bunch of secret scripts and
dark magic. Provide 'arc liberate' which endeavors to always do the right thing
and put a library in the correct state.
Test Plan:
Ran liberate on libphutil, arcanist, phabricator; created new
libphutil libraries, added classes to them, liberated everything, introduced
errors etc and liberated that stuff, nothing was obviously broken in a terrible
way..?
Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: aran, epriestley
Differential Revision: 269
2011-05-12 01:30:22 +02:00
|
|
|
return $root.'/'.$script;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|