当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Spinner.stop方法代码示例

本文整理汇总了TypeScript中clui.Spinner.stop方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Spinner.stop方法的具体用法?TypeScript Spinner.stop怎么用?TypeScript Spinner.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在clui.Spinner的用法示例。


在下文中一共展示了Spinner.stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: setInterval

const interval = setInterval(() => {
  n--;
  countdown.message(`Exiting in ${n} seconds...`);
  if (n === 0) {
    console.log('\n');
    countdown.stop();
    clearInterval(interval);
  }
}, 1000);
开发者ID:ChaosinaCan,项目名称:DefinitelyTyped,代码行数:9,代码来源:clui-tests.ts

示例2: return

		return (() => {
			let [platform, version] = platformParam.split("@");

			this.validatePlatform(platform);

			let platformPath = path.join(this.$projectData.platformsDir, platform);

			if (this.$fs.exists(platformPath).wait()) {
				this.$errors.failWithoutHelp("Platform %s already added", platform);
			}

			let platformData = this.$platformsData.getPlatformData(platform);

			// Copy platform specific files in platforms dir
			let platformProjectService = platformData.platformProjectService;
			platformProjectService.validate().wait();

			// Log the values for project
			this.$logger.trace("Creating NativeScript project for the %s platform", platform);
			this.$logger.trace("Path: %s", platformData.projectRoot);
			this.$logger.trace("Package: %s", this.$projectData.projectId);
			this.$logger.trace("Name: %s", this.$projectData.projectName);

			this.$logger.out("Copying template files...");

			let packageToInstall = "";
			let npmOptions: IStringDictionary = {
				pathToSave: path.join(this.$projectData.platformsDir, platform)
			};

			if (this.$options.frameworkPath) {
				packageToInstall = this.$options.frameworkPath;
			} else {
				packageToInstall = platformData.frameworkPackageName;
				npmOptions["version"] = version;
			}

			let spinner = new clui.Spinner("Installing " + packageToInstall);
			try {
				spinner.start();
				let downloadedPackagePath = this.$npmInstallationManager.install(packageToInstall, npmOptions).wait();
				let frameworkDir = path.join(downloadedPackagePath, constants.PROJECT_FRAMEWORK_FOLDER_NAME);
				frameworkDir = path.resolve(frameworkDir);

				this.addPlatformCore(platformData, frameworkDir).wait();
			} catch (err) {
				this.$fs.deleteDirectory(platformPath).wait();
				throw err;
			} finally {
				spinner.stop();
			}

			this.$logger.out("Project successfully created.");

		}).future<void>()();
开发者ID:Emat12,项目名称:nativescript-cli,代码行数:55,代码来源:platform-service.ts


注:本文中的clui.Spinner.stop方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。