Changeset View
Changeset View
Standalone View
Standalone View
scripts/arcanist.php
| Show First 20 Lines • Show All 635 Lines • ▼ Show 20 Lines | try { | ||||
| phutil_console_format("%s: %s\n", | phutil_console_format("%s: %s\n", | ||||
| pht('WARNING'), | pht('WARNING'), | ||||
| $error))); | $error))); | ||||
| } | } | ||||
| } catch (PhutilLibraryConflictException $ex) { | } catch (PhutilLibraryConflictException $ex) { | ||||
| if ($ex->getLibrary() != 'arcanist') { | if ($ex->getLibrary() != 'arcanist') { | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| $arc_dir = dirname(dirname(__FILE__)); | |||||
| $error = pht( | // NOTE: If you are running `arc` against itself, we ignore the library | ||||
| "You are trying to run one copy of Arcanist on another copy of ". | // conflict created by loading the local `arc` library (in the current | ||||
| "Arcanist. This operation is not supported. To execute Arcanist ". | // working directory) and continue without loading it. | ||||
| "operations against this working copy, run `%s` (from the current ". | |||||
| "working copy) not some other copy of '%s' (you ran one from '%s').", | // This means we only execute code in the `arcanist/` directory which is | ||||
| './bin/arc', | // associated with the binary you are running, whereas we would normally | ||||
| 'arc', | // excute local code. | ||||
| $arc_dir); | |||||
| throw new ArcanistUsageException($error); | // This can make `arc` development slightly confusing if your setup is | ||||
| // especially bizarre, but it allows `arc` to be used in automation | |||||
| // workflows more easily. For some context, see PHI13. | |||||
| $executing_directory = dirname(dirname(__FILE__)); | |||||
| $working_directory = dirname($location); | |||||
| fwrite( | |||||
| STDERR, | |||||
| tsprintf( | |||||
| "**<bg:yellow> %s </bg>** %s\n", | |||||
| pht('VERY META'), | |||||
| pht( | |||||
| 'You are running one copy of Arcanist (at path "%s") against '. | |||||
| 'another copy of Arcanist (at path "%s"). Code in the current '. | |||||
| 'working directory will not be loaded or executed.', | |||||
| $executing_directory, | |||||
| $working_directory))); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||