Skip to content

Commit da503d9

Browse files
committed
refactor: Add auto-generated comment to commands.php file
Also mark /data folder as non-publishable.
1 parent 59d2685 commit da503d9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
* text=auto
22

3-
/tests export-ignore
43
/.editorconfig export-ignore
54
/.gitattributes export-ignore
65
/.github export-ignore
76
/.gitignore export-ignore
87
/.scripts export-ignore
8+
/data export-ignore
9+
/tests export-ignore
910
/phpunit.xml.dist export-ignore

data/compile.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@
8484
});
8585

8686
$php = str_replace(' ', ' ', var_export($commands, true));
87+
$php = preg_replace('#^array \(#', 'array(', $php);
8788
$php = preg_replace('#\s+=>\s+array \(#', " => array(", $php);
8889

89-
file_put_contents(dirname(__FILE__) . '/../library/PhpLatex/commands.php', '<?php return ' . $php . ";\n");
90+
file_put_contents(
91+
dirname(__FILE__) . '/../library/PhpLatex/commands.php',
92+
"<?php // File generated automatically by " . basename(__FILE__) . " script. DO NOT EDIT.\n\nreturn {$php};\n"
93+
);
9094

library/PhpLatex/commands.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php return array (
1+
<?php // File generated automatically by compile.php script. DO NOT EDIT.
2+
3+
return array(
24
'\\ ' => array(
35
'mode' => 'both',
46
'numArgs' => 0,

0 commit comments

Comments
 (0)