feat: disable ANSI-colored output (NO_COLOR) #15

Merged
squel merged 2 commits from squel/nocolor into main 2025-01-26 16:07:56 +00:00 AGit
Owner
https://no-color.org/
moving the failure checking to func main allows us
to handle multiple manifest inputs as follows:
- if there are files that have been updated
  (changed) as specified in a more recent
  manifest-file and thus in a later iteration, we
  will not show errors because they are checking
  against an old hash as specified in an old
  manifest file
- if there are files missing in the current
  iteration, but present in a later manifest-file,
  we will not show errors because they are missing

this is with the following caveats:
- it is assumed that the last input is the most
  recent or otherwise "most correct". this **will
  be** an issue because the ManifestID by
  Valve/Steam (secondary part of the filename:
  AppID_ManifestID.manifest) is **not**
  incrementative and thus not in alphabetical
  order (which is what shells will expand
  wildcards to). an improvement will be check the
  manifests' CreationTime metadata
- failed (hash mismatch or missing) entries will
  be shown last in the output, instead of in the
  order in which they completed processing. this
  is fine to me however, since it was
  multithreaded and thus semi-random to begin with
  and does not impact UX whatsover. if anything
  this is an improvement imo
- code structure wise it is kinda bad to have such
  a long Action, plus the failures are counted in
  two different places but ¯\_(ツ)_/¯
decoder_test.go:119: expected error type [manifest
encrypted], got incorrect signature magic header:
read [17b8811b83000000] expected
[17b8811b00000000]: unexpected bytes

because the handling of the magic is extracted
into a separate function, it checked the above
error first (return value of handleMagic())
avoid having to go from keymap to array to another array

i really dont know how i like either solution tbh

makes e119809951 unnecessary
> "Note: in many situations, the newer slices.SortFunc function is more ergonomic and runs faster. "
https://pkg.go.dev/sort#Slice
target file is no longer present (removed in an
update) but the old manifest still contains an
entry: warn the user
squel changed title from refactor: use helper function to feat: disable ANSI-colored output (NO_COLOR) 2025-01-07 09:37:20 +00:00
squel force-pushed squel/nocolor from 8b6d3df604 to a6d53ffa0f 2025-01-26 16:07:48 +00:00 Compare
squel merged commit a6d53ffa0f into main 2025-01-26 16:07:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
Reference
squel/steam-manifest!15
No description provided.