Skip to content

Commit 18265cf

Browse files
Add missing "post-install-output" to flex endpoint
1 parent e901969 commit 18265cf

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/GenerateFlexEndpointCommand.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,15 @@ private function generatePackageJson(string $repository, string $sourceBranch, b
9595

9696
foreach (new \RecursiveIteratorIterator($it) as $path => $file) {
9797
$file = substr($path, 1 + \strlen($package.'/'.$version));
98-
if (is_dir($path) || \in_array($file, ['manifest.json', 'post-install.txt', 'Makefile'], true)) {
98+
if (is_dir($path) || 'manifest.json' === $file) {
99+
continue;
100+
}
101+
if ('post-install.txt' === $file) {
102+
$manifest['post-install-output'] = explode("\n", rtrim(str_replace("\r", '', file_get_contents($path)), "\n"));
103+
continue;
104+
}
105+
if ('Makefile' === $file) {
106+
$manifest['makefile'] = explode("\n", rtrim(str_replace("\r", '', file_get_contents($path)), "\n"));
99107
continue;
100108
}
101109
$contents = file_get_contents($path);

src/LintManifestsCommand.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,16 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9393
}
9494

9595
foreach (scandir("$package/$version") as $file) {
96+
$path = "$package/$version/$file";
97+
9698
if (\in_array($file, self::SPECIAL_FILES, true)) {
99+
if (is_file($path) && !preg_match('//u', file_get_contents($path))) {
100+
$output->writeln(sprintf('::error file=%s::File "%s" must be UTF-8 encoded', $path, $file));
101+
$exit = 1;
102+
}
97103
continue;
98104
}
99105

100-
$path = "$package/$version/$file";
101-
102106
if (is_dir($path)) {
103107
if (isset($data['copy-from-recipe'][$file.'/'])) {
104108
// no-op

0 commit comments

Comments
 (0)