Skip to content

Commit e1ce45e

Browse files
authored
Merge pull request #35 from mvanduijker/main
Fix tty not read/writable on build command inside Docker
2 parents c5e520a + 91d3303 commit e1ce45e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Commands/BuildCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Illuminate\Support\Facades\File;
77
use Illuminate\Support\Facades\Process;
88
use Tonysm\TailwindCss\Manifest;
9+
use Symfony\Component\Process\Process as SymfonyProcess;
910

1011
class BuildCommand extends Command
1112
{
@@ -48,7 +49,7 @@ public function handle()
4849
}
4950

5051
Process::forever()
51-
->tty(PHP_OS != 'WINNT' && is_writable('/dev/tty'))
52+
->tty(SymfonyProcess::isTtySupported())
5253
->path(base_path())
5354
->run(array_filter([
5455
$binFile,

src/Commands/InstallCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Support\Facades\Process;
88
use Illuminate\Support\Str;
99
use Symfony\Component\Process\PhpExecutableFinder;
10+
use Symfony\Component\Process\Process as SymfonyProcess;
1011
use Tonysm\TailwindCss\Actions\AppendTailwindTag;
1112

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

169170
private function runFirstBuild()
170171
{
171-
Process::forever()->tty(PHP_OS != 'WINNT' && is_writable('/dev/tty'))->run([
172+
Process::forever()->tty(SymfonyProcess::isTtySupported())->run([
172173
$this->phpBinary(),
173174
'artisan',
174175
'tailwindcss:build',

0 commit comments

Comments
 (0)