Commit 923a1b6 1 parent 02a3974 commit 923a1b6 Copy full SHA for 923a1b6
File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -220,13 +220,13 @@ private function askTask(string $file): Task
220
220
private function dryRunRector (string $ file ): bool
221
221
{
222
222
$ this ->output ->writeln ('<fg=white;bg=blue>Checking file ' . $ file . ' ...</> ' );
223
- $ exitCode = $ this ->runCommand ("rector process --ansi --no-progress-bar --dry-run " . $ file );
223
+ $ exitCode = $ this ->runCommand ($ this -> getBinPath () . "rector process --ansi --no-progress-bar --dry-run " . $ file );
224
224
return $ exitCode === 0 ;
225
225
}
226
226
227
227
private function executeRector (string $ file ): void
228
228
{
229
- $ exitCode = $ this ->runCommand ("rector process --ansi --no-progress-bar --no-diffs " . $ file );
229
+ $ exitCode = $ this ->runCommand ($ this -> getBinPath () . "rector process --ansi --no-progress-bar --no-diffs " . $ file );
230
230
if ($ exitCode ) {
231
231
exit ($ exitCode );
232
232
}
@@ -243,4 +243,13 @@ private function runCommand(string $command): int
243
243
$ this ->output ->writeln ('<fg=gray>duration: ' . round ($ duration , 3 ) . 's</> ' , OutputInterface::VERBOSITY_DEBUG );
244
244
return $ exitCode ;
245
245
}
246
+
247
+ private function getBinPath (): string
248
+ {
249
+ if (isset ($ GLOBALS ['_composer_bin_dir ' ])) {
250
+ return $ GLOBALS ['_composer_bin_dir ' ] . '/ ' ;
251
+ }
252
+
253
+ return '' ;
254
+ }
246
255
}
You can’t perform that action at this time.
0 commit comments