Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tty not read/writable on build command inside Docker #35

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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