node-steam / vdf

Module to convert Valve's KeyValue format to JSON and back
https://node-steam.github.io/vdf/
MIT License
34 stars 3 forks source link

Misses keys and includes comments in output #11

Open rhys-vdw opened 3 years ago

rhys-vdw commented 3 years ago
"appbuild"
{
  // Set the app ID that this script will upload.
  "appid"  "1320870"

  // The description for this build.
  // The description is only visible to you in the 'Your Builds' section of the App Admin panel.
  // This can be changed at any time after uploading a build on the 'Your Builds' page.
  "desc" "Your build description here"

  // Enable/Disable whether this a preview build.
  // It's highly recommended that you use preview builds while doing the initially setting up SteamPipe to
  // ensure that the depot manifest contains the correct files.
  "preview" "0"

  // File path of the local content server if it's enabled.
  "local" ""

  // Branch name to automatically set live after successful build, none if empty.
  // Note that the 'default' branch can not be set live automatically. That must be done through the App Admin panel.
  "setlive" ""

  // The following paths can be absolute or relative to location of the script.

  // This directory will be the location for build logs, chunk cache, and intermediate output (.log, .csm & .csd files).
  // The cache stored within this causes future SteamPipe uploads to complete quicker by using diffing.
  // Relative to the location of this file.
  "buildoutput" ".\output\"

  // USAGE NOTE: https://steamcommunity.com/groups/steamworks/discussions/0/558747287746664712/#c558747287764472692
  // The root of the content folder, relative to location of this file
  "contentroot" "..\..\..\Builds\"

  // The list of depots included in this build.
  "depots"
  {
    "1320871" "depot_build_win_1320871.vdf"
    "1320872" "depot_build_macos_1320872.vdf"
    "1320873" "depot_build_linux_1320873.vdf"
  }
}

output:

{
  appbuild: {
    appid: 1320870,
    desc: 'Your build description here',
    preview: 0,
    local: '',
    setlive: '',
    buildoutput: '.\\output\\"\n' +
      '\n' +
      '  // USAGE NOTE: https://steamcommunity.com/groups/steamworks/discussions/0/558747287746664712/#c558747287764472692\n' +
      '  // The root of the content folder, relative to location of this file\n' +
      '  ',
    depots: {
      '1320871': 'depot_build_win_1320871.vdf',
      '1320872': 'depot_build_macos_1320872.vdf',
      '1320873': 'depot_build_linux_1320873.vdf'
    }
  }
}

Note overread on buildoutput and complete absence of contentroot field. This is basically the example vdf file from Steam docs so I'm surprised to have his this error. Tried changing line endings to CRLF and LF and it made no difference.

Interestingly I had the exact same error using vdf package and jumped to this one when I noticed there was a new alternative. I hope my input is not somehow malformed?

rhys-vdw commented 3 years ago

Alright, it seems to be choking on this line:

  "buildoutput" ".\output\"

I guess it's misinterpreting the final \ as an escape character?

rhys-vdw commented 3 years ago

Check out the "simple build script" example here: https://partner.steamgames.com/doc/sdk/uploading?language=english

"AppBuild"
{
        "AppID" "1000" // your AppID
        "Desc" "This is a simple build script" // internal description for this build

        "ContentRoot" "..\content\" // root content folder, relative to location of this file
        "BuildOutput" "..\output\" // build output folder for build logs and build cache files

        "Depots"
        {
                "1001" // your DepotID
                {
                        "FileMapping"
                        {
                                "LocalPath" "*" // all files from contentroot folder
                                "DepotPath" "." // mapped into the root of the depot
                                "recursive" "1" // include all subfolders
                        }
                }
        }
}

Even this is output incorrectly:

{
  AppBuild: {
    AppID: 1000,
    Desc: 'This is a simple build script',
    ContentRoot: '..\\content\\" // root content folder, relative to location of this file\n\t',
    Depots: {
      '1001': { FileMapping: { LocalPath: '*', DepotPath: '.', recursive: 1 } }
    }
  }
}