Skip to content
Closed
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion steam_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ echo "# Uploading build #"
echo "#################################"
echo ""

steamcmd +login "$steam_username" +run_app_build "$manifest_path" +quit || (
steam_login_args="+login "$steam_username""
if [ "$steam_totp" != "INVALID" ]; then
steam_login_args="+set_steam_guard_code "$steam_totp" $steam_login_args"
fi
Copy link

@coderabbitai coderabbitai bot Apr 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

⚠️ Potential issue

Fix quoting issues in dynamic login argument construction.

The concatenation of strings for steam_login_args on lines 167 and 169 is problematic. The embedded double quotes are not escaped, which causes the shell to unquote parts of the command and can lead to syntax errors or unexpected behavior. For example, the assignment in line 167:

steam_login_args="+login "$steam_username""

should properly escape the inner quotes. A suggested fix is:

-    steam_login_args="+login "$steam_username""
+    steam_login_args="+login \"$steam_username\""

Similarly, on line 169:

steam_login_args="+set_steam_guard_code "$steam_totp" $steam_login_args"

should be updated to:

-      steam_login_args="+set_steam_guard_code "$steam_totp" $steam_login_args"
+      steam_login_args="+set_steam_guard_code \"$steam_totp\" $steam_login_args"

This ensures that any spaces or special characters in the parameters are correctly managed and that the static analysis warnings (SC2027) are resolved.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 167-167: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)


[warning] 169-169: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since every other parameter is passed the same way in this script, this should be fine

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JanWerder You're absolutely right. I've checked the file and confirmed that this parameter passing style (using "$variable" without escaping the quotes) is consistently used throughout the script, such as in the test login command on line 97. Maintaining consistency in coding style across the codebase is important. Thanks for the clarification!


steamcmd $steam_login_args +run_app_build "$manifest_path" +quit || (
echo ""
echo "#################################"
echo "# Errors #"
Expand Down