Bladeren bron

support running npm packages and procfiles.

both are a bit daring, but they might work. :)
Lucas Stadler 11 jaren geleden
bovenliggende
commit
6347d5ebcb
1 gewijzigde bestanden met toevoegingen van 3 en 2 verwijderingen
  1. 3 2
      go/detect/detect.go

+ 3 - 2
go/detect/detect.go

@ -38,7 +38,8 @@ var ProjectTypes = []*Project{
38 38
	&Project{"idris/default", Commands{"run": "idris -o $(basename {file} .idr) {file} && ./$(basename {file} .idr)"},
39 39
		matchPattern("*.idr")},
40 40
	&Project{"java/maven", Commands{"build": "mvn compile", "test": "mvn compile test"}, matchFile("pom.xml")},
41
	&Project{"javascript/npm", Commands{"build": "npm install", "test": "npm test"}, matchFile("package.json")},
41
	&Project{"javascript/npm", Commands{"build": "npm install", "run": "npm start", "test": "npm test"},
42
		matchFile("package.json")},
42 43
	&Project{"javascript/meteor", Commands{"run": "meteor"}, matchFile(".meteor/.id")},
43 44
	&Project{"javascript/default", Commands{"run": "node {file}"}, matchPattern("*.js")},
44 45
	&Project{"julia/default", Commands{"run": "julia {file}"}, matchPattern("*.jl")},
@ -54,7 +55,7 @@ var ProjectTypes = []*Project{
54 55
	&Project{"rust/default", Commands{"run": "rustc {file} && ./$(basename {file} .rs)"}, matchPattern("*.rs")},
55 56
	&Project{"cmake", Commands{"build": "mkdir .build && cd .build && cmake .. && make"}, matchFile("CMakeLists.txt")},
56 57
	&Project{"make", Commands{"run": "make", "test": "make test"}, matchFile("Makefile")},
57
	&Project{"procfile", Commands{}, matchFile("Procfile")},
58
	&Project{"procfile", Commands{"run": "$(sed -n 's/^web: //p' Procfile)"}, matchFile("Procfile")},
58 59
}
59 60
60 61
func Detect(file string) (*Project, error) {