@sprucelabs/spruce-cli
Version:
Command line interface for building Spruce skills.
33 lines • 1.28 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const spruce_skill_utils_1 = require("@sprucelabs/spruce-skill-utils");
const NodePackageManager_1 = __importDefault(require("../packageManager/NodePackageManager"));
const GoPackageManager_1 = require("./GoPackageManager");
class PkgService extends spruce_skill_utils_1.PkgService {
packageManager;
constructor(cwd, commandService) {
super(cwd);
const PackageManagerClass = spruce_skill_utils_1.diskUtil.detectProjectLanguage(cwd) === 'go'
? GoPackageManager_1.GoPackageManager
: NodePackageManager_1.default;
this.packageManager = new PackageManagerClass({
cwd,
commandService,
pkgService: this,
});
}
async install(pkg, options) {
return this.packageManager.installDependencies(pkg, options);
}
getSkillNamespace() {
return this.get('skill.namespace');
}
async uninstall(pkg) {
return this.packageManager.uninstallDependencies?.(pkg);
}
}
exports.default = PkgService;
//# sourceMappingURL=PkgService.js.map