It would be really nice if we could create conditions based on the existence of a file/directory (even better a glob pattern).
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Interesting idea for a feature. You can simulate this using a script task that sets a variable.
- bash: |
if [ -f your-file-here.txt ]; then
echo "##vso[task.setVariable variable=FILEEXISTS]true"
fi
- task: Foo@1
condition: eq(variables.FILEEXISTS, 'true')
(From memory, not tested, etc.)
Thanks for the feedback! That's pretty much the kind of workaround I'm using for this.
Most helpful comment
Interesting idea for a feature. You can simulate this using a script task that sets a variable.
(From memory, not tested, etc.)