Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Command: Add logging for native custom commands #1128

Merged
merged 2 commits into from
Jun 18, 2024
Merged
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
15 changes: 10 additions & 5 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240617-1"
PROGVERS="v14.0.20240619-1"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -7183,6 +7183,11 @@ function extProtonRun {

# TODO pass "$EXTPROGRAMARGS" to programs running with Wine as well(?)
# TODO refactor a bit to be a little cleaner if possible
# TODO it should be possible to pass PROTON_LOG to these Proton commands, however this also requries SteamGameId to be set -- This is not defined outside of Steam AND inside of Steam it would conflict with an actual Game ID if used
# if we want to use PROTON_LOG we need the ability to pass in PROTON_LOG=? and a custom SteamGameId that is only set for these program runs
# i.e. a default SteamGameId could be `extProtonRun`, but launchCustomProg could pass `customcommand`.
#
# This would be tricky to add, but would be nice to have!
CUSTPROGNAME="$( basename "$PROGRAM" )"
if [ "$MODE" == "F" ]; then # Forked Proton/Wine 'normal' custom program
if [ -n "${RUNPROGARGS[0]}" ]; then
Expand Down Expand Up @@ -12928,20 +12933,20 @@ function launchCustomProg {
writelog "INFO" "${FUNCNAME[0]} - FORK_CUSTOMCMD is set to 1 - forking the custom program in background and continue"
if [ -n "${RUNEXTPROGRAMARGS[0]}" ]; then
writelog "INFO" "${FUNCNAME[0]} - \"${RUNEXTPROGRAMARGS[*]}\" \"${LACO}\" \"${RUNCUSTOMCMD_ARGS[*]}\""
(sleep "$FWAIT"; notiShow "$( strFix "$NOTY_CUSTPROG_FORKED_NATIVE" "$NATIVEPROGNAME" )"; "${RUNEXTPROGRAMARGS[@]}" "$LACO" "${RUNCUSTOMCMD_ARGS[@]}") &
(sleep "$FWAIT"; notiShow "$( strFix "$NOTY_CUSTPROG_FORKED_NATIVE" "$NATIVEPROGNAME" )"; "${RUNEXTPROGRAMARGS[@]}" "$LACO" "${RUNCUSTOMCMD_ARGS[@]}" 2>&1 | tee "$STLSHM/${FUNCNAME[0]}.log") &
else
writelog "INFO" "${FUNCNAME[0]} - \"${LACO}\" \"${RUNCUSTOMCMD_ARGS[*]}\""
(sleep "$FWAIT"; notiShow "$( strFix "$NOTY_CUSTPROG_FORKED_NATIVE" "$NATIVEPROGNAME" )"; "$LACO" "${RUNCUSTOMCMD_ARGS[@]}") &
(sleep "$FWAIT"; notiShow "$( strFix "$NOTY_CUSTPROG_FORKED_NATIVE" "$NATIVEPROGNAME" )"; "$LACO" "${RUNCUSTOMCMD_ARGS[@]}" 2>&1 | tee "$STLSHM/${FUNCNAME[0]}.log") &
fi
else # Regular native executable
writelog "INFO" "${FUNCNAME[0]} - Starting native custom command regularly"
notiShow "$( strFix "$NOTY_CUSTPROG_REG_NATIVE" "$NATIVEPROGNAME" )"
if [ -n "${RUNEXTPROGRAMARGS[0]}" ]; then
writelog "INFO" "${FUNCNAME[0]} - \"${RUNEXTPROGRAMARGS[*]}\" \"${LACO}\" \"${RUNCUSTOMCMD_ARGS[*]}\""
"${RUNEXTPROGRAMARGS[@]}" "$LACO" "${RUNCUSTOMCMD_ARGS[@]}"
"${RUNEXTPROGRAMARGS[@]}" "$LACO" "${RUNCUSTOMCMD_ARGS[@]}" 2>&1 | tee "$STLSHM/${FUNCNAME[0]}.log"
else
writelog "INFO" "${FUNCNAME[0]} - \"${LACO}\" \"${RUNCUSTOMCMD_ARGS[*]}\""
"$LACO" "${RUNCUSTOMCMD_ARGS[@]}"
"$LACO" "${RUNCUSTOMCMD_ARGS[@]}" 2>&1 | tee "$STLSHM/${FUNCNAME[0]}.log"
fi
fi
fi
Expand Down