1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Set php PATH for repository's hook

Summary:
~~Set PATH for repository's hook, so the environment.append-paths can used~~
repository's hook may can't find php path if user's profile like bash_profile is not loaded.

Test Plan: check the hook generated is contain the right path

Reviewers: epriestley, #blessed_reviewers

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7743
This commit is contained in:
iodragon 2014-01-03 09:38:51 -08:00 committed by epriestley
parent 5ce0edaf69
commit f981d50f5d

View file

@ -159,7 +159,13 @@ final class PhabricatorRepositoryPullEngine
$root = dirname(phutil_get_library_root('phabricator'));
$bin = $root.'/bin/commit-hook';
$cmd = csprintf('exec %s %s "$@"', $bin, $callsign);
$full_php_path = Filesystem::resolveBinary('php');
$cmd = csprintf(
'exec %s -f %s -- %s "$@"',
$full_php_path,
$bin,
$callsign);
$hook = "#!/bin/sh\n{$cmd}\n";