Skip to content

Commit 962d7f0

Browse files
committed
Fix: diagnose command copy diagnostics not actually copying.
For some unknown reason, the copying of the diagnostics to the clipboard just stopped working. To fix this, changed the cli type to powershell to ensure that the copy command `clip` is available. Also changed where the diagnostics text file are saved to for copying. They now save to the valet home directory `~/.config/valet`. Otherwise, it'll try to save to the current working directory of the terminal, which could potentially be a protected directory like `Program Files`.
1 parent 9f0701c commit 962d7f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cli/Valet/Diagnose.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ protected function copyToClipboard($output) {
376376
// Code based on https://stackoverflow.com/a/40731340/2358222
377377
$output = preg_replace('/(\e)|([[]|[]])[A-Za-z0-9];*[0-9]*m?/', '', $output);
378378

379-
$this->files->put('valet_diagnostics.txt', $output);
380-
$this->cli->run('type valet_diagnostics.txt | clip');
381-
$this->files->unlink('valet_diagnostics.txt');
379+
$this->files->put(VALET_HOME_PATH . '/valet_diagnostics.txt', $output);
380+
$this->cli->powershell('type ' . VALET_HOME_PATH . '/valet_diagnostics.txt | clip');
381+
$this->files->unlink(VALET_HOME_PATH . '/valet_diagnostics.txt');
382382
}
383383

384384
/**

0 commit comments

Comments
 (0)