Creating a simple task to clean folders
To get comfortable with creating extensions, in this recipe, we will create a simple pipeline extension. This extension will contain a single task to take a minmatch
search pattern (https://aka.ms/minimatchexamples) and delete files and/or folders in a specified directory. The task can be used in the build or release pipeline to clean build artifacts, and eventually you will publish the cleaned directory.
Getting ready
We are going to develop this extension using TypeScript, which automatically gets transpiled into JavaScript. Writing in JavaScript ensures that this extension is automatically cross-platform and hence a task, or tasks, can run on Windows, Mac, or Linux-based agents. Our development environment will be as follows:
- Editor – VSCode: Free developer-friendly editor. However, you are free to use any editor with which you are comfortable.
- Language – Typescript: Provides type checking and other benefits (more info can be found here: https://www...