@@ -58,6 +58,7 @@ hasWget=
5858hasCurl=
5959hasSetsid=
6060hasNixOSFacter=
61+ remoteHomeDir=
6162
6263tempDir=$( mktemp -d)
6364trap ' rm -rf "$tempDir"' EXIT
@@ -571,23 +572,34 @@ importFacts() {
571572 if ! facts=$( runSsh -o ConnectTimeout=10 enableDebug=$enableDebug sh -- < " $here " /get-facts.sh) ; then
572573 exit 1
573574 fi
574- filteredFacts=$( echo " $facts " | grep -E ' ^(has|is)[A-Za-z0-9_]+=\S+' )
575+ filteredFacts=$( echo " $facts " | grep -E ' ^(has|is|remote )[A-Za-z0-9_]+=\S+' )
575576 if [[ -z $filteredFacts ]]; then
576577 abort " Retrieving host facts via SSH failed. Check with --debug for the root cause, unless you have done so already"
577578 fi
579+
580+ # disable debug output temporarily to prevent log spam
581+ set +x
582+
578583 # make facts available in script
579584 # shellcheck disable=SC2046
580585 export $( echo " $filteredFacts " | xargs)
581586
582587 # Necessary to prevent Bash erroring before printing out which fact had an issue
583588 set +u
584- for var in isOs isArch isInstaller isContainer isRoot hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid; do
589+ for var in isOs isArch isInstaller isContainer isRoot hasIpv6Only hasTar hasCpio hasSudo hasDoas hasWget hasCurl hasSetsid remoteHomeDir ; do
585590 if [[ -z ${! var} ]]; then
586591 abort " Failed to retrieve fact $var from host"
587592 fi
588593 done
589594 set -u
590595
596+ # Compute the log file path from the home directory
597+ remoteLogFile=" ${remoteHomeDir} /.nixos-anywhere.log"
598+
599+ if [[ -n ${enableDebug} ]]; then
600+ set -x
601+ fi
602+
591603 if [[ ${isRoot} == " y" ]]; then
592604 maybeSudo=
593605 elif [[ ${hasSudo} == " y" ]]; then
0 commit comments