Skip to content

Commit 41619e6

Browse files
use the install path of composer on windows
1 parent e905010 commit 41619e6

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea/
2+
/nbproject/private/

subsystems/tasks/Tasks/Commands/MiscCommands.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Electro\Kernel\Config\KernelSettings;
1111
use Electro\Kernel\Services\ModulesInstaller;
1212
use Electro\Tasks\Shared\Base\ComposerTask;
13-
use Robo\Task\Composer\Update;
1413
use Robo\Task\FileSystem\CleanDir;
1514
use Robo\Task\FileSystem\FilesystemStack;
1615
use Robo\Task\Vcs\GitStack;
@@ -90,7 +89,7 @@ function reinstall ($opts = ['overwrite|o' => false])
9089

9190
// Reinstall all packages
9291
(new ComposerTask)->action ('clearcache')->printed ($cOut)->run ();
93-
$composerUpdate = (new Update)->printed ($cOut); // Load class BEFORE its package is removed
92+
$composerUpdate = (new ComposerTask)->action('update')->printed ($cOut); // Load class BEFORE its package is removed
9493
$this->clearDir ($this->kernelSettings->packagesPath);
9594
$this->clearDir ($this->kernelSettings->pluginsPath);
9695
$composerUpdate->run ();

subsystems/tasks/Tasks/Commands/UpdateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use Electro\Interfaces\ConsoleIOInterface;
66
use Electro\Kernel\Lib\ModuleInfo;
77
use Electro\Kernel\Services\ModulesRegistry;
8-
use Robo\Task\Composer\DumpAutoload;
8+
use Electro\Tasks\Shared\Base\ComposerTask;
99

1010
/**
1111
* Defines a command that rebuilds the project's composer.json file by merging relevant sections from the project
@@ -31,7 +31,7 @@ function composerUpdate ($opts = ['no-update' => false])
3131

3232
$this->regenerateComposer ();
3333
if (get ($opts, 'no-update'))
34-
(new DumpAutoload)->run ();
34+
(new ComposerTask)->action('dump-autoload')->option('--optimize')->run ();
3535
else $this->doComposerUpdate ();
3636

3737
$this->io->done ("The project is <info>updated</info>");

subsystems/tasks/Tasks/Shared/Base/ComposerTask.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
class ComposerTask extends Base
88
{
9+
public function __construct()
10+
{
11+
parent::__construct(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'?'C:\\ProgramData\\ComposerSetup\\bin\\composer':null);
12+
}
13+
914
function action ($action)
1015
{
1116
$this->action = $action;

subsystems/tasks/Tasks/Tasks/CoreTasks.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Electro\Tasks\Commands\UpdateCommand;
1717
use Electro\Tasks\Config\TasksSettings;
1818
use PhpKit\Flow\FilesystemFlow;
19-
use Robo\Task\Composer\Update;
19+
use Electro\Tasks\Shared\Base\ComposerTask;
2020
use Robo\Task\FileSystem\CleanDir;
2121
use Robo\Task\FileSystem\FilesystemStack;
2222

@@ -103,7 +103,7 @@ private function clearDir ($path)
103103
*/
104104
private function doComposerUpdate ()
105105
{
106-
(new Update)->printed (self::$SHOW_COMPOSER_OUTPUT)->run ();
106+
(new ComposerTask)->action('update')->printed (self::$SHOW_COMPOSER_OUTPUT)->run ();
107107
}
108108

109109
/**

0 commit comments

Comments
 (0)