Skip to content

Commit 7d01377

Browse files
authored
[BUGFIX] Fix invalid check for .ts files (#376)
Resolves: #374
1 parent 93cc01d commit 7d01377

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/typo3-fractor/rules/TYPO3v13/TypoScript/MigrateIncludeTypoScriptSyntaxFractor.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,12 @@ public function refactor(Statement $statement): null|Statement
122122
$source = $item->path();
123123

124124
// Rename all *.ts files to *.typoscript
125-
$destination = str_replace('.ts', '.typoscript', $source);
126-
$this->filesystem->move($source, $destination);
125+
if (str_ends_with($source, '.ts')) {
126+
$destination = str_replace('.ts', '.typoscript', $source);
127+
if ($this->filesystem->fileExists($source)) {
128+
$this->filesystem->move($source, $destination);
129+
}
130+
}
127131

128132
$statement->extensions = 'typoscript';
129133
}

0 commit comments

Comments
 (0)