Skip to content

Commit

Permalink
bug #22 Allowing a custom input_path relative to the project (weaverr…
Browse files Browse the repository at this point in the history
…yan)

This PR was merged into the main branch.

Discussion
----------

Allowing a custom input_path relative to the project

The option is already documented this way, but wasn't working unless it was the full path.

Should be repeated for https://github.com/SymfonyCasts/sass-bundle

Commits
-------

aa904a5 Allowing a custom input_path relative to the project
  • Loading branch information
weaverryan committed Aug 30, 2023
2 parents eb47b4b + aa904a5 commit 804b82c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/TailwindBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,23 @@
class TailwindBuilder
{
private ?SymfonyStyle $output = null;
private readonly string $inputPath;

public function __construct(
private readonly string $projectRootDir,
private readonly string $inputPath,
string $inputPath,
private readonly string $tailwindVarDir,
private readonly ?string $binaryPath = null,
) {
if (is_file($inputPath)) {
$this->inputPath = $inputPath;
} else {
$this->inputPath = $projectRootDir.'/'.$inputPath;

if (!is_file($this->inputPath)) {
throw new \InvalidArgumentException(sprintf('The input CSS file "%s" does not exist.', $inputPath));
}
}
}

public function runBuild(bool $watch): Process
Expand Down

0 comments on commit 804b82c

Please sign in to comment.