2020-09-17 07:43:45 -07:00
|
|
|
package main
|
|
|
|
|
2020-10-01 11:57:02 -07:00
|
|
|
type node struct {
|
2020-11-14 11:04:04 -08:00
|
|
|
language *language
|
2020-09-17 07:43:45 -07:00
|
|
|
}
|
|
|
|
|
2020-10-01 11:57:02 -07:00
|
|
|
func (n *node) string() string {
|
2020-11-14 11:04:04 -08:00
|
|
|
return n.language.string()
|
2020-09-17 07:43:45 -07:00
|
|
|
}
|
|
|
|
|
2020-10-01 11:57:02 -07:00
|
|
|
func (n *node) init(props *properties, env environmentInfo) {
|
2020-11-14 11:04:04 -08:00
|
|
|
n.language = &language{
|
2021-02-03 10:11:32 -08:00
|
|
|
env: env,
|
|
|
|
props: props,
|
2021-02-06 09:10:38 -08:00
|
|
|
extensions: []string{"*.js", "*.ts", "package.json", ".nvm"},
|
2021-02-03 10:11:32 -08:00
|
|
|
commands: []*cmd{
|
|
|
|
{
|
|
|
|
executable: "node",
|
|
|
|
args: []string{"--version"},
|
|
|
|
regex: `(?:v(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+).(?P<patch>[0-9]+))))`,
|
|
|
|
},
|
2021-01-10 03:14:43 -08:00
|
|
|
},
|
2021-02-03 10:11:32 -08:00
|
|
|
versionURLTemplate: "[%[1]s](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V%[2]s.md#%[1]s)",
|
2021-02-06 22:06:24 -08:00
|
|
|
matchesVersionFile: n.matchesVersionFile,
|
2020-11-14 11:04:04 -08:00
|
|
|
}
|
2020-09-17 07:43:45 -07:00
|
|
|
}
|
|
|
|
|
2020-10-01 11:57:02 -07:00
|
|
|
func (n *node) enabled() bool {
|
2020-11-14 11:04:04 -08:00
|
|
|
return n.language.enabled()
|
2020-09-17 07:43:45 -07:00
|
|
|
}
|
2021-02-06 22:06:24 -08:00
|
|
|
|
|
|
|
func (n *node) matchesVersionFile() bool {
|
|
|
|
return true
|
|
|
|
}
|