Page MenuHomePhabricator

Masterwork_From_Distant_Lands

Authored By
avivey
Mar 30 2015, 5:01 PM
Size
761 B
Referenced Files
None
Subscribers
None

Masterwork_From_Distant_Lands

#!/usr/bin/env php
<?php
require_once dirname(__FILE__).'/arcanist/scripts/__init_script__.php';
function resolveBinary2($binary) {
if (phutil_is_windows()) {
echo "phutil is windows\n";
list($err, $stdout) = exec_manual('where %s', $binary);
$stdout = phutil_split_lines($stdout);
// If `where %s` could not find anything, check for relative binary
if ($err) {
$path = Filesystem::resolvePath($binary);
if (Filesystem::pathExists($path)) {
return $path;
}
return null;
}
$stdout = head($stdout);
} else {
list($err, $stdout) = exec_manual('which %s', $binary);
echo "exec actually worked";
}
return $err === 0 ? trim($stdout) : null;
}
echo resolveBinary2('git');
echo "\n";

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/av/ve/qxpgbspgbgjevopf
Default Alt Text
Masterwork_From_Distant_Lands (761 B)

Event Timeline