Sublime Forum

file_patterns in build system

#1

Build 3084 release notes say:
Build Systems may now define a list of file name wildcard patterns to trigger on, via the file_patterns key

What is the syntax for that? Tried adding a file_patterns key to a build system def, but that caused an error.

"build_systems":

    {
        "name": "build1",
        "shell_cmd": "deploy build1"
    },
    {
        "name": "build2",
        "file_patterns": "*Foo.js",
        "shell_cmd": "deploy build2"
    }
]

On build:
init() got an unexpected keyword argument ‘file_patterns’

0 Likes

#2

It’s not currently working for the general case (i.e., when used with target: exec, which is the default), I’ll fix that for the next build.

Also btw, file_patterns needs to be an array of strings, rather than a single string.

1 Like

#3

Confirmed, at least doesn’t works for Build System defined in project.
I suppose the “file_patterns” is passed as argument to the Exec command which passed it to the “class AsyncProcess” where it’s not expected.
It probably must be filtered before calling Exec command, or a “**kwargs” must be added to the AsyncProcess.run().

In addition, if you put a “name” entry in a .sublime-build file, this entry is correctly used as name for the build in the Command Palette (replacing the file name), but trigger the same error.

0 Likes