Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .vortex/docs/.utils/update-videos.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,13 @@ function main(array $argv): int {
return 0;
}

exit(main($argv));
// A failure inside main() reports itself before it is thrown, so the message
// alone is the whole error.
try {
exit(main($argv));
}
catch (Throwable $exception) {
fwrite(STDERR, $exception->getMessage() . "\n");

exit(1);
}
4 changes: 3 additions & 1 deletion .vortex/installer/src/Utils/FileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ public function prepareDestination(): array {

// The destination arrives from a CLI option, the environment or a config
// file, so it is escaped rather than interpolated into the shell string.
$command = sprintf('git --work-tree=%s --git-dir=%s init > /dev/null', escapeshellarg($destination), escapeshellarg($destination . '/.git'));
// 'git init' writes the initial branch advice to stderr when
// 'init.defaultBranch' is unset, and passthru() draws it inside the TUI.
$command = sprintf('git -c advice.defaultBranchName=false --work-tree=%s --git-dir=%s init > /dev/null', escapeshellarg($destination), escapeshellarg($destination . '/.git'));
passthru($command, $exit_code);

if ($exit_code !== 0 || !File::exists($destination . '/.git')) {
Expand Down