move ext map language to config
This commit is contained in:
@@ -8,17 +8,9 @@ import (
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/metrue/fx/commands/common"
|
||||
"github.com/metrue/fx/config"
|
||||
)
|
||||
|
||||
var langs = map[string]string{
|
||||
".js": "node",
|
||||
".go": "go",
|
||||
".rb": "ruby",
|
||||
".py": "python",
|
||||
".php": "php",
|
||||
".jl": "julia",
|
||||
}
|
||||
|
||||
// Up starts the functions specified in flags
|
||||
func Up() {
|
||||
option := "up"
|
||||
@@ -50,7 +42,7 @@ func Up() {
|
||||
numFail++
|
||||
continue
|
||||
}
|
||||
lang := langs[filepath.Ext(function)]
|
||||
lang := config.ExtLangMap[filepath.Ext(function)]
|
||||
worker := NewWorker(function, lang, conn, channel)
|
||||
go worker.Work()
|
||||
}
|
||||
|
||||
@@ -16,3 +16,12 @@ var Client = map[string]string{
|
||||
"cache_dir": path.Join(os.Getenv("HOME"), ".fx/"),
|
||||
"remote_images_url": "https://raw.githubusercontent.com/metrue/fx/master/images.zip",
|
||||
}
|
||||
|
||||
var ExtLangMap = map[string]string {
|
||||
".js": "node",
|
||||
".go": "go",
|
||||
".rb": "ruby",
|
||||
".py": "python",
|
||||
".php": "php",
|
||||
".jl": "julia",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user