Skip to content

Commit

Permalink
Merge pull request #35 from mvanduijker/main
Browse files Browse the repository at this point in the history
Fix tty not read/writable on build command inside Docker
  • Loading branch information
tonysm authored Oct 15, 2024
2 parents c5e520a + 91d3303 commit e1ce45e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Process;
use Tonysm\TailwindCss\Manifest;
use Symfony\Component\Process\Process as SymfonyProcess;

class BuildCommand extends Command
{
Expand Down Expand Up @@ -48,7 +49,7 @@ public function handle()
}

Process::forever()
->tty(PHP_OS != 'WINNT' && is_writable('/dev/tty'))
->tty(SymfonyProcess::isTtySupported())
->path(base_path())
->run(array_filter([
$binFile,
Expand Down
5 changes: 3 additions & 2 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Facades\Process;
use Illuminate\Support\Str;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process as SymfonyProcess;
use Tonysm\TailwindCss\Actions\AppendTailwindTag;

class InstallCommand extends Command
Expand Down Expand Up @@ -53,7 +54,7 @@ private function ensureTailwindConfigExists()
private function ensureTailwindCliBinaryExists()
{
if (! File::exists(config('tailwindcss.bin_path')) || $this->option('download')) {
Process::forever()->tty(PHP_OS != 'WINNT' && is_writable('/dev/tty'))->run([
Process::forever()->tty(SymfonyProcess::isTtySupported())->run([
$this->phpBinary(),
'artisan',
'tailwindcss:download',
Expand Down Expand Up @@ -168,7 +169,7 @@ private function addIngoreLines()

private function runFirstBuild()
{
Process::forever()->tty(PHP_OS != 'WINNT' && is_writable('/dev/tty'))->run([
Process::forever()->tty(SymfonyProcess::isTtySupported())->run([
$this->phpBinary(),
'artisan',
'tailwindcss:build',
Expand Down

0 comments on commit e1ce45e

Please sign in to comment.