From a730fb98f811d1eb499e5c4610ae99aefcf8a934 Mon Sep 17 00:00:00 2001 From: Kyle Neideck Date: Fri, 13 May 2022 12:03:33 +1000 Subject: [PATCH] Installer: Log more audio device info if BGMDevice doesn't appear. --- .github/workflows/build-test-release.yml | 12 ++++++------ pkg/postinstall | 10 ++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 3bc2a9e..ff3f37f 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -109,7 +109,10 @@ jobs: test echo '::endgroup::' - name: Uninstall Background Music. - run: genv --default-signal=PIPE yes | sudo ./uninstall.sh + run: | + # `tput` expects this to be set. + export TERM=xterm-256color + genv --default-signal=PIPE yes | sudo ./uninstall.sh - name: Check the BGM dirs and files were removed. run: | if ls -la "/Applications/Background Music.app"; then exit 1; fi @@ -156,11 +159,8 @@ jobs: -dumplog - name: Print the installer logs. if: always() - run: | - echo '::group::install.log' - # This trims the start of the log to save space. - grep -E -A 9999 -B 20 'Background.?Music' /var/log/install.log - echo '::endgroup::' + # This trims the start of the log to save space. + run: grep -E -A 9999 -B 20 'Background.?Music' /var/log/install.log - name: Check the BGM dirs and files were installed again. if: always() run: | diff --git a/pkg/postinstall b/pkg/postinstall index 899558a..4bd9480 100755 --- a/pkg/postinstall +++ b/pkg/postinstall @@ -75,6 +75,16 @@ while [[ $retries -gt 0 ]]; do # installer GUI instead of just logging them. See # . log "Background Music device not found. Installation failed." + log "Audio devices:" + log $(system_profiler SPAudioDataType) + log "Audio input devices:" + log $(echo 'import AVFoundation + let discoverySession = AVCaptureDevice.DiscoverySession( + deviceTypes: [ .builtInMicrophone, .externalUnknown ], + mediaType: .audio, + position: .unspecified + ) + print(discoverySession.devices)' | swift -) exit 1 fi else