Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ support ] Execute a shell script #159

Open
yonas opened this issue Jul 16, 2024 · 1 comment
Open

[ support ] Execute a shell script #159

yonas opened this issue Jul 16, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@yonas
Copy link

yonas commented Jul 16, 2024

Is it possible to execute a shell script?

@yonas yonas added the enhancement New feature or request label Jul 16, 2024
@siyul-park
Copy link
Owner

siyul-park commented Jul 18, 2024

It is not supported by default due to security concerns, but you can implement the Compiler and Program from the language package to add this functionality.

func NewCompiler() language.Compiler {
	return language.CompileFunc(func(code string) (language.Program, error) {
		return language.RunFunc(func(_ any) (any, error) {
			return code, nil
		}), nil
	})
}
langs := language.NewModule()
langs.Store(text.Language, text.NewCompiler())
lang.Store(json.Language, json.NewCompiler())
langs.Store(yaml.Language, yaml.NewCompiler())
langs.Store(cel.Language, cel.NewCompiler())
langs.Store(javascript.Language, javascript.NewCompiler())
langs.Store(typescript.Language, typescript.NewCompiler())

sbuilder.Register(control.AddToScheme(langs, cel.Language))

After finding a way to resolve the security issues, we will add this feature to the roadmap. What is the reason for wanting to execute shell scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants