當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FS.getFolderPath方法代碼示例

本文整理匯總了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;
  }
開發者ID:charlespockert,項目名稱:monterey,代碼行數:25,代碼來源:common.ts

示例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;
        }
      }
    }
  }
開發者ID:charlespockert,項目名稱:monterey,代碼行數:22,代碼來源:analyzer.ts


注:本文中的monterey-pal.FS.getFolderPath方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。