Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 958e735

Browse files
authored
Merge pull request #16 from bstoney/master
Windows install fixes
2 parents 5c78a33 + 4674570 commit 958e735

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/Installer/Installer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ protected function executeComposerCommand($installPath, $beVerbose = false)
102102
if ($beVerbose) {
103103
echo "\n";
104104
passthru(
105-
'PATH=' . getenv('PATH') . ' ' .
105+
'PATH=' . getenv('PATH') . ' && ' .
106106
$this->composerCmd . ' --prefer-dist --no-interaction --working-dir="' .
107107
$installPath .'" create-project litipk/jupyter-php=0.* pkgs',
108108

src/System/UnixSystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function checkIfCommandExists($cmdName)
4747
"if command -v ".$cmdName." >/dev/null 2>&1; then echo \"true\"; else echo \"false\"; fi;"
4848
);
4949

50-
return filter_var($sysResponse, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
50+
return filter_var($sysResponse, FILTER_VALIDATE_BOOLEAN);
5151
}
5252

5353
/** @return string|null */

src/System/WindowsSystem.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ public function getCurrentUserHome()
3939
*/
4040
public function checkIfCommandExists($cmdName)
4141
{
42-
return true;
42+
if (!function_exists('exec')) {
43+
return false;
44+
}
45+
46+
$sysResponse = exec("where $cmdName > nul 2>&1 && echo true");
47+
48+
return filter_var($sysResponse, FILTER_VALIDATE_BOOLEAN);
4349
}
4450

4551
/** @return string */

0 commit comments

Comments
 (0)