feat: rework default entries
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
from ..entry import Entry
|
||||
|
||||
|
||||
class NodejsEntry(Entry):
|
||||
TYPE: str = "nodejs"
|
||||
COMMANDS = {
|
||||
"setup": [
|
||||
["npm", "install-clean"],
|
||||
],
|
||||
"test": [
|
||||
["npm", "test"],
|
||||
],
|
||||
}
|
||||
|
||||
def __init__(self, basepath: Path):
|
||||
super().__init__(self.TYPE, self.COMMANDS, basepath)
|
||||
|
||||
@classmethod
|
||||
def detect(cls, basepath: Path) -> Optional["NodejsEntry"]:
|
||||
if (basepath / "package.json").exists():
|
||||
return cls(basepath)
|
||||
Reference in New Issue
Block a user