0.0.4 • Published 7 months ago

@build-script/heft-shell-plugin v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

shell task - 运行任意程序

类似heft官方内部插件run-script-plugin,但允许运行任意程序。(例如python、bash)

fieldtypedescription
interpreterstring解释器。如果不设置默认为node(此时功能和run-script-plugin一样)
interpreterArgsstring[]解释器参数
scriptstring脚本路径
argsstring[]脚本参数
envRecord<string, string>环境变量
inheritEnvboolean默认为true,设为false时使用空白环境变量
workingDirectorystring工作目录,默认为.,相对于包根目录
{
	"hello": {
		"taskDependencies": ["typescript"],
		"taskPlugin": {
			"pluginName": "shell",
			"pluginPackage": "@build-script/heft-plugins",
			"options": {
				// 将会运行: python3 -B hello.py aaa
				"interpreter": "python3",
				"interpreterArgs": ["-B"],
				"script": "hello.py",
				"args": ["aaa"],
				"env": { "PYTHONUTF8": "1" },
				"inheritEnv": true,
			},
		},
	},
	"bash": {
		"taskDependencies": ["typescript"],
		"taskPlugin": {
			"pluginName": "shell",
			"pluginPackage": "@build-script/heft-plugins",
			"options": {
				// 将会运行: bash -c 'echo hello'
				"interpreter": "bash",
				"interpreterArgs": ["-c"],
				"script": "echo hello",
			},
		},
	},
}
0.0.4

7 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago