Summary: allow specifing an replacement .arcrc file, for the odd cases.
Test Plan: `echo {} | arc call-conduit user.whoami` with and without `--arcrc-file=`
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley
CC: Korvin, aran
Differential Revision: https://secure.phabricator.com/D7208
array(
'name' => 'skip-arcconfig',
),
+ array(
+ 'name' => 'arcrc-file',
+ 'param' => 'filename',
+ ),
array(
'name' => 'conduit-uri',
'param' => 'uri',
$force_conduit_version = $args->getArg('conduit-version');
$conduit_timeout = $args->getArg('conduit-timeout');
$skip_arcconfig = $args->getArg('skip-arcconfig');
+$custom_arcrc = $args->getArg('arcrc-file');
$load = $args->getArg('load-phutil-library');
$help = $args->getArg('help');
$working_copy);
}
+ if ($custom_arcrc) {
+ $configuration_manager->setUserConfigurationFileLocation($custom_arcrc);
+ }
$user_config = $configuration_manager->readUserConfigurationFile();
$config_class = $working_copy->getProjectConfig('arcanist_configuration');
private $runtimeConfig = array();
private $workingCopy = null;
+ private $customArcrcFilename = null;
public function setWorkingCopyIdentity(
ArcanistWorkingCopyIdentity $working_copy) {
return false;
}
-
/**
* This is probably not the method you're looking for; try
* @{method:readUserArcConfig}.
}
}
+ public function setUserConfigurationFileLocation($custom_arcrc) {
+ if (!Filesystem::pathExists($custom_arcrc)) {
+ throw new Exception(
+ "Custom arcrc file was specified, but it was not found!");
+ }
+
+ $this->customArcrcFilename = $custom_arcrc;
+ }
+
public function getUserConfigurationFileLocation() {
+ if (strlen($this->customArcrcFilename)) {
+ return $this->customArcrcFilename;
+ }
+
if (phutil_is_windows()) {
return getenv('APPDATA').'/.arcrc';
} else {
__--conduit-timeout__ __timeout__
Override the default Conduit timeout. Specified in seconds.
+ __--skip-arcconfig__
+ Skip the working copy configuration file
+
+ __--arcrc-file__ __filename__
+ Use provided file instead of ~/.arcrc.
EOTEXT
);
}