Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/workflow/ArcanistShellCompleteWorkflow.php
Show First 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | private function runInstall() { | ||||
$replace = preg_match( | $replace = preg_match( | ||||
'/(\s*\n)?[^\n]+# arcanist-shell-complete\s*(\n\s*)?/', | '/(\s*\n)?[^\n]+# arcanist-shell-complete\s*(\n\s*)?/', | ||||
$data, | $data, | ||||
$matches, | $matches, | ||||
PREG_OFFSET_CAPTURE); | PREG_OFFSET_CAPTURE); | ||||
$log->writeSuccess( | $log->writeSuccess( | ||||
pht('INSTALL'), | pht('INSTALL'), | ||||
pht('Installing shell completion support for "%s".', $shell)); | pht( | ||||
'Installing shell completion support for "%s" into "%s".', | |||||
$shell, | |||||
$file_display)); | |||||
if ($replace) { | if ($replace) { | ||||
$replace_pos = $matches[0][1]; | $replace_pos = $matches[0][1]; | ||||
$replace_line = $matches[0][0]; | $replace_line = $matches[0][0]; | ||||
$replace_len = strlen($replace_line); | $replace_len = strlen($replace_line); | ||||
$replace_display = trim($replace_line); | $replace_display = trim($replace_line); | ||||
if ($replace_pos === 0) { | if ($replace_pos === 0) { | ||||
▲ Show 20 Lines • Show All 420 Lines • Show Last 20 Lines |