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


TypeScript project.nullProject函數代碼示例

本文整理匯總了TypeScript中ember-cli/lib/models/project.nullProject函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript nullProject函數的具體用法?TypeScript nullProject怎麽用?TypeScript nullProject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了nullProject函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: function

  run: function (commandOptions: any, rawArgs: string[]) {
    const packageName = rawArgs.shift();

    if (!packageName) {
      return Promise.reject(new SilentError(
        `The "ng ${this.name}" command requires a name argument to be specified. ` +
        `For more details, use "ng help".`));
    }

    commandOptions.name = packageName;
    if (commandOptions.dryRun) {
      commandOptions.skipGit = true;
    }

    if (packageName === '.') {
      return Promise.reject(new SilentError(
        `Trying to generate an application structure in this directory? Use "ng init" ` +
        `instead.`));
    }

    if (!validProjectName(packageName)) {
      return Promise.reject(
        new SilentError(`We currently do not support a name of "${packageName}".`));
    }

    if (commandOptions.mobile) {
      return Promise.reject(new SilentError(
        'The --mobile flag has been disabled temporarily while we await an update of ' +
        'angular-universal for supporting NgModule. Sorry for the inconvenience.'
      ));
    }

    commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);

    if (!commandOptions.directory) {
      commandOptions.directory = packageName;
    }

    const createAndStepIntoDirectory =
      new this.tasks.CreateAndStepIntoDirectory({ ui: this.ui, analytics: this.analytics });

    const initCommand = new InitCommand({
      ui: this.ui,
      analytics: this.analytics,
      tasks: this.tasks,
      project: Project.nullProject(this.ui, this.cli)
    });

    return createAndStepIntoDirectory
      .run({
        directoryName: commandOptions.directory,
        dryRun: commandOptions.dryRun
      })
      .then(initCommand.run.bind(initCommand, commandOptions, rawArgs));
  }
開發者ID:StudioProcess,項目名稱:angular-cli,代碼行數:55,代碼來源:new.ts

示例2: function

    run: function(commandOptions, rawArgs) {
        const packageName = rawArgs.shift();

        if (!packageName) {
            return Promise.reject(new SilentError(
              `The "ng ${this.name}" command requires a name argument to be specified. ` +
              `For more details, use "ng help".`
            ));
        }

        commandOptions.name = packageName;
        if (commandOptions.dryRun){
            commandOptions.skipGit = true;
        }

        if (packageName === '.') {
            return Promise.reject(new SilentError(
              `Trying to generate an application structure in this directory? Use "ng init" ` +
              `instead.`
            ));
        }

        if (!validProjectName(packageName)) {
            return Promise.reject(new SilentError(
              `We currently do not support a name of "${packageName}".`
            ));
        }

        commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);

        if (!commandOptions.directory) {
            commandOptions.directory = packageName;
        }

        const createAndStepIntoDirectory  = new this.tasks.CreateAndStepIntoDirectory({
            ui: this.ui,
            analytics: this.analytics
        });

        const initCommand = new InitCommand({
            ui: this.ui,
            analytics: this.analytics,
            tasks: this.tasks,
            project: Project.nullProject(this.ui, this.cli)
        });

        return createAndStepIntoDirectory
          .run({
              directoryName: commandOptions.directory,
              dryRun: commandOptions.dryRun
          })
          .then(initCommand.run.bind(initCommand, commandOptions, rawArgs));
    }
開發者ID:Sundar-Natarajan,項目名稱:angular-cli,代碼行數:53,代碼來源:new.ts


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