Page MenuHomePhabricator

Add Powershell support to Arcanist documentation
Open, Needs TriagePublic

Description

There is no exact replacement for adding the batch file to the system path, however using Arc in powershell is straightforward. All you have to do is add this function to your powershell profile. This has the benefit of not requiring the arc install directory be in the system path.

function arc { php -f "PATH_TO_INSTALL\scripts\arcanist.php" -- $args }

Event Timeline

abrahams renamed this task from Add Powershell support to Arcanist to Add Powershell support to Arcanist documentation.
abrahams raised the priority of this task from to Needs Triage.
abrahams updated the task description. (Show Details)
abrahams added a project: Arcanist.
abrahams added a subscriber: abrahams.

Why would you not just add arc to your PATH? That can be either done through the UI, or permanently via Powershell:

$current = [Environment]::GetEnvironmentVariable("PATH", "Machine")
[Environment]::SetEnvironmentVariable("PATH", $current + ";C:\Tools\Arcanist\arcanist\bin", "Machine")

Then arc will work in all terminals (Command Prompt, Bash and Powershell).

It's nicer not to add things to the path variable unless necessary. Also, manually uninstalling or changing the installation directory by changing your path is more arduous than altering a line in your PS profile. Arc runs perfectly well without adding anything except PHP to the path, therefore a function is a cleaner solution for powershell-specific installation instructions.

Also, that script will tack on multiple copies of c:\tools\arcanist\arcanist\bin to the path if it is accidentally run more than once. I think there is a cmdlet to do it safely in the Powershell Community Extensions called Add-PathVariable.