[PATCH] D127938: Update Windows packaging script.

Douglas Yung via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 00:01:04 PDT 2022


dyung added a comment.

Just a general comment, but when writing batch scripts, I tend to avoid using parenthesis with if blocks like you are proposing here. I've found that in the past they can lead to some obscure issues that I think were impossible to work around if something either in the same line or contained within it expanded to include parenthesis (such as "Program Files (x86)".

So instead of something like this:

  if not defined base-dir (
    set "base-dir=%TMP%"
  )

I would write it using a goto like this:

  if defined base-dir goto :BaseDirDefined
    set "base-dir=%TMP%"
  :BaseDirDefined

This way you avoid using potentially problematic parenthesis.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127938/new/

https://reviews.llvm.org/D127938



More information about the llvm-commits mailing list