Sublime Forum

Do `file_patterns` of `build_systems` work?

#1

I’m trying to set up different build_systems and cmd line options for different scripts under one project. According to the documentation, we can do it by selecting file_patterns for which the given build will be triggered, but setting it doesn’t seem to have any effect on the cmd used for running the build.

0 Likes

#2

Would you mind sharing your build system?

0 Likes

#3

Yes, thanks for the suggestion:

"build_systems":
[
	{
		"file_patterns":["agreement.py"],
		"cmd":
		[
			"python", "-u", "$file", "-m"
		],
		"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
		"name": "Conda py37",
		"path": "/Users/XXX/anaconda3/envs/py37/bin:/usr/bin",
		"selector": "source.python",
		"working_dir": "/Users/XXX"
	},
	{
		"file_patterns":["analysis.py"],
		"cmd":
		[
			"python", "-u", "$file", "-a"
		],
		"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
		"name": "Conda py37",
		"path": "/Users/XXX/anaconda3/envs/py37/bin:/usr/bin",
		"selector": "source.python",
		"working_dir": "/Users/XXX"
	}
]
0 Likes