Skip to content

Commit e3f41f9

Browse files
authored
recognize .rs extention as a Rust action kind (#495)
1 parent 23b5790 commit e3f41f9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

commands/action.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ const (
5656
PHP_EXT = ".php"
5757
BAL_BIN_EXT = ".balx"
5858
RUBY_EXT = ".rb"
59+
RUST_EXT = ".rs"
5960
GO_EXT = ".go"
6061
NODE_JS = "nodejs"
6162
PYTHON = "python"
6263
JAVA = "java"
6364
SWIFT = "swift"
6465
PHP = "php"
6566
RUBY = "ruby"
67+
RUST = "rust"
6668
GO = "go"
6769
BAL = "ballerina"
6870
DEFAULT = "default"
@@ -644,6 +646,8 @@ func getExec(args []string, params ActionFlags) (*whisk.Exec, error) {
644646
exec.Kind = fmt.Sprintf("%s:%s", PHP, DEFAULT)
645647
} else if ext == RUBY_EXT {
646648
exec.Kind = fmt.Sprintf("%s:%s", RUBY, DEFAULT)
649+
} else if ext == RUST_EXT {
650+
exec.Kind = fmt.Sprintf("%s:%s", RUST, DEFAULT)
647651
} else if ext == GO_EXT {
648652
exec.Kind = fmt.Sprintf("%s:%s", GO, DEFAULT)
649653
} else if ext == BAL_BIN_EXT {
@@ -693,6 +697,8 @@ func getKindExtension(runtime string) (extension string) {
693697
extension = fmt.Sprintf(".%s", runtime)
694698
case RUBY:
695699
extension = RUBY_EXT
700+
case RUST:
701+
extension = RUST_EXT
696702
case GO:
697703
extension = GO_EXT
698704
}

0 commit comments

Comments
 (0)