File picker is simple tool, helping you to select file while running vs code task.
Example 'tasks.json' file to build project in monorepo with lerna
{
"version": "2.0.0",
"inputs": [
{
"id": "pickerInput",
"type": "command",
"command": "filePicker.pick",
"args": {
"masks": "apps/*/package.json",
"display": {
"type": "json",
"json": "name",
"detail": "fileRelativePath",
"description": {
"type": "json",
"json": "description"
}
},
"output": "filePath"
}
}
],
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "echo ${pickerInput:p}",
"problemMatcher": []
}
]
}masks<string | string[]>Masks to file searchdisplay<DisplayType | DisplayConfig>File names presentation typeoutput<DisplayType | DisplayConfig>Output presentation type
DisplayType:
nonereturnsundefinedfileNamereturns file name (ex. readme.md)filePathreturns absolute file path (ex c:/Projects/proj/info/readme.md)fileRelativePathreturns file path, relative to workspace (ex info/readme.md)dirNamereturs name of directory containings file (ex. info)dirPathreturs absolute path to directory containings file (ex. c:/Projects/proj/info)dirRelativePathreturs relative path to directory containings file (ex. info)jsonreads file as json object and returns value of property, specified inPresentationConfig.jsonproperty
PresentationConfig:
type<DisplayType>Presentation typejson<string>Path to property of json file
DisplayConfig:
type<DisplayType>Presentation typejson<string>Path to property of json filedescription<PresentationConfig>Rule to get file description (to show in vs code picker)detail<PresentationConfig>Rule to get file details (to show in vs code picker)