Files
project-manager/project_manager/entries/nodejs.py
T
2023-03-15 10:26:33 +03:00

25 lines
548 B
Python

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)