Skip to content

Commit 9537dc5

Browse files
committed
sanity check on old style annotations
1 parent 69475a0 commit 9537dc5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PatternLab/Annotations.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public static function gather() {
9494
if (file_exists($oldStyleAnnotationsPath)) {
9595
$text = file_get_contents($oldStyleAnnotationsPath);
9696
$text = str_replace("var comments = ","",$text);
97-
$text = rtrim($text,";");
97+
if ($text[strlen($text)-1] == ";") {
98+
$text = rtrim($text,";");
99+
}
98100
$data = json_decode($text,true);
99101
if ($jsonErrorMessage = JSON::hasError()) {
100102
JSON::lastErrorMsg(Console::getHumanReadablePath($oldStyleAnnotationsPath),$jsonErrorMessage,$data);

0 commit comments

Comments
 (0)