本文整理匯總了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;
}
}
}
}