Skip to content

Commit

Permalink
Move twig template inside template dir
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and OskarStark committed Aug 11, 2020
1 parent 7bbb769 commit f6423f6
Show file tree
Hide file tree
Showing 33 changed files with 21 additions and 4 deletions.
1 change: 0 additions & 1 deletion .flintci.yml

This file was deleted.

5 changes: 5 additions & 0 deletions .flintci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
composernormalize: true
phpcsfixer: true
yamllint: true
xmllint: true
1 change: 0 additions & 1 deletion .yamllint

This file was deleted.

7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
document-start: disable
line-length:
max: 120
level: warning
1 change: 1 addition & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
bind:
string $appDir: '%kernel.project_dir%'
string $devKitToken: '%env(DEK_KIT_TOKEN)%'

# makes classes in src/ available to be used as services
Expand Down
10 changes: 8 additions & 2 deletions src/Command/DispatchCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ final class DispatchCommand extends AbstractNeedApplyCommand
{
private const LABEL_NOTHING_CHANGED = 'Nothing to be changed.';

/**
* @var string
*/
private $appDir;

/**
* @var GitWrapper
*/
Expand All @@ -52,10 +57,11 @@ final class DispatchCommand extends AbstractNeedApplyCommand
*/
private $projects;

public function __construct(GitWrapper $gitWrapper, Filesystem $fileSystem, Environment $twig)
public function __construct(string $appDir, GitWrapper $gitWrapper, Filesystem $fileSystem, Environment $twig)
{
parent::__construct();

$this->appDir = $appDir;
$this->gitWrapper = $gitWrapper;
$this->fileSystem = $fileSystem;
$this->twig = $twig;
Expand Down Expand Up @@ -451,7 +457,7 @@ private function dispatchFiles(Package $package): void
*/
private function renderFile(Package $package, $repositoryName, $localPath, $distPath, array $projectConfig, $branchName): void
{
$localFullPath = __DIR__.'/../../'.$localPath;
$localFullPath = $this->appDir.'/templates/'.$localPath;
$localFileType = filetype($localFullPath);
$distFileType = $this->fileSystem->exists($distPath) ? filetype($distPath) : false;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f6423f6

Please sign in to comment.