本文整理汇总了TypeScript中monterey-pal.FS.getFolderPath方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FS.getFolderPath方法的具体用法?TypeScript FS.getFolderPath怎么用?TypeScript FS.getFolderPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类monterey-pal.FS
的用法示例。
在下文中一共展示了FS.getFolderPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: installNPMDependencies
installNPMDependencies(project, deps = [], estimation = 'This could take minutes to complete') {
let task = {
title: `npm install of '${project.name}'`,
estimation: estimation,
logs: [],
promise: null
};
let promise = NPM.install(deps, {
npmOptions: {
workingDirectory: FS.getFolderPath(project.packageJSONPath)
},
logCallback: (message) => {
if (message.level === 'custom' || message.level === 'warning' || message.level === 'error') {
this.taskManager.addTaskLog(task, message.message);
}
}
});
task.promise = promise;
this.taskManager.addTask(task);
return task;
}
示例2: lookupInstalledVersions
async lookupInstalledVersions(project, topLevelDependencies) {
let deps;
try {
deps = await NPM.ls({ workingDirectory: FS.getFolderPath(project.packageJSONPath) });
} catch (e) {
console.log(e);
}
if (deps && deps.dependencies) {
let keys = Object.keys(deps.dependencies);
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let dep = deps.dependencies[key];
let tld = topLevelDependencies.find(x => x.name === key);
if (tld) {
tld.version = dep.version;
tld.missing = dep.missing;
}
}
}
}