jens1101 / SteamCMD-JS-Interface

Allows you to access and use SteamCMD via JavaScript
14 stars 1 forks source link

Not reporting progress on app_update (verification) #40

Closed dagerikhl closed 3 weeks ago

dagerikhl commented 5 months ago

Hi! šŸ‘‹

Firstly, thanks for your work on this project! šŸ™‚

Today I used patch-package to patch steamcmd-interface@4.0.2 for the project I'm working on.

Problem

The regex that tests for progress in the updateApp doesn't handle spaces in the state part, so e.g. verifying install doesn't match the regex, and no progress is reported.

About the diff below, perhaps ([^,]+) would be a more robust pattern for the state, in case other things can be introduced there by Steam.


Here is the diff that solved my problem:

diff --git a/node_modules/steamcmd-interface/dist/steam-cmd.js b/node_modules/steamcmd-interface/dist/steam-cmd.js
index 107b6eb..0756cf9 100644
--- a/node_modules/steamcmd-interface/dist/steam-cmd.js
+++ b/node_modules/steamcmd-interface/dist/steam-cmd.js
@@ -1066,7 +1066,7 @@ class SteamCmd {
      */

-    const progressRegex = /Update state \((0x\d+)\) (\w+), progress: (\d+.\d+) \((\d+) \/ (\d+)\)$/;
+    const progressRegex = /Update state \((0x\d+)\) ([\w\s]+), progress: (\d+.\d+) \((\d+) \/ (\d+)\)$/;

     for await (const line of this.run(commands)) {
       // Test the current line of output

This issue body was partially generated by patch-package.

jens1101 commented 4 weeks ago

Thanks @dagerikhl for the issue and investigation you did. I will make this change as part of the next release.