nightroman / Invoke-Build

Build Automation in PowerShell

Home Page:https://github.com/nightroman/Invoke-Build/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the default script resolution rule

nightroman opened this issue · comments

The current old rule:

If the file is omitted then Invoke-Build looks for *.build.ps1 files in
the current location. A single file is used as the script. If there are
more files then .build.ps1 is used if it exists, otherwise build fails.

The proposed new rule:

If the file is omitted then Invoke-Build looks for *.build.ps1 files in
the current location and takes the first in Sort-Object order.

Why?

  • The new rule is more flexible, we do not have to use the fixed name .build.ps1.
  • Dot files (including .build.ps1) are treated as hidden on Unix like systems.

The change is potentially incompatible. But chances of breaking anything are
low because .build.ps1 is more likely the first in Sort-Object order,
if you have several *.build.ps1 files in the same directory.