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


TypeScript task.rmRF函数代码示例

本文整理汇总了TypeScript中azure-pipelines-task-lib/task.rmRF函数的典型用法代码示例。如果您正苦于以下问题:TypeScript rmRF函数的具体用法?TypeScript rmRF怎么用?TypeScript rmRF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: deleteSecureFile

 /**
  * Delete secure file from the temporary location for the build
  * @param secureFileId
  */
 deleteSecureFile(secureFileId: string): void {
     const tempDownloadPath: string = this.getSecureFileTempDownloadPath(secureFileId);
     if (tl.exist(tempDownloadPath)) {
         tl.debug('Deleting secure file at: ' + tempDownloadPath);
         tl.rmRF(tempDownloadPath);
     }
 }
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:11,代码来源:securefiles-common.ts

示例2: run

export async function run(packagingLocation: PackagingLocation): Promise<void> {
    const workingDir = tl.getInput(NpmTaskInput.WorkingDir) || process.cwd();
    const npmrc = npmutil.getTempNpmrcPath();
    const npmRegistry: INpmRegistry = await getPublishRegistry(packagingLocation);

    tl.debug(tl.loc('PublishRegistry', npmRegistry.url));
    npmutil.appendToNpmrc(npmrc, `registry=${npmRegistry.url}\n`);
    npmutil.appendToNpmrc(npmrc, `${npmRegistry.auth}\n`);

    // For publish, always override their project .npmrc
    const npm = new NpmToolRunner(workingDir, npmrc, true);
    npm.line('publish');

    npm.execSync();

    tl.rmRF(npmrc);
    tl.rmRF(util.getTempPath());
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:18,代码来源:npmpublish.ts

示例3: restoreFileWithName

export function restoreFileWithName(file: string, name: string, filePath: string): void {
    if (file) {
        const source = path.join(filePath, name + '.npmrc');
        if (tl.exist(source)) {
            tl.debug(tl.loc('RestoringFile', file));
            copyFile(source, file);
            tl.rmRF(source);
        }
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:10,代码来源:util.ts

示例4: run

async function run() {
    tl.setResourcePath(path.join(__dirname, "task.json"));
    const pypircPath = tl.getVariable("PYPIRC_PATH");
    if (tl.exist(pypircPath)) {
        tl.debug(tl.loc("Info_RemovingPypircFile", pypircPath));
        tl.rmRF(pypircPath);
    }
    else {
        console.log(tl.loc("NoPypircFile"));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:11,代码来源:authcleanup.ts

示例5: restoreFile

export function restoreFile(file: string): void {
    if (file) {
        const tempPath = getTempPath();
        const baseName = path.basename(file);
        const source = path.join(tempPath, baseName);

        if (tl.exist(source)) {
            tl.debug(tl.loc('RestoringFile', file));
            copyFile(source, file);
            tl.rmRF(source);
        }
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:13,代码来源:util.ts

示例6: function

		feedConnection.getCoreApi().restClient.get(packageUrl, ApiVersion, null, { responseIsCollection: false }, async function (error, status, result) {
			if (!!error || status != 200) {
				return reject(tl.loc("FailedToGetPackageMetadata", error));
			}

			var packageType = result.protocolType.toLowerCase();
			var packageName = result.name;

			if (packageType == "nuget") {
				
				var getDownloadUrlPromise = getDownloadUrl(packageConnection.getCoreApi().vsoClient, feedId, packageName, version)
				getDownloadUrlPromise.catch((error) => {
					return reject(error)
				});
				var downloadUrl = await getDownloadUrlPromise;
				
				if (!tl.exist(downloadPath)) {
					tl.mkdirP(downloadPath);
				}

				var zipLocation = path.resolve(downloadPath, "../", packageName) + ".zip";
				var unzipLocation = path.join(downloadPath, "");

				console.log(tl.loc("StartingDownloadOfPackage", packageName, zipLocation));
				
				var downloadNugetPackagePromise = downloadNugetPackage(packageConnection.getCoreApi(), downloadUrl, zipLocation);
				downloadNugetPackagePromise.catch((error) => {
					return reject(error)
				});
				await downloadNugetPackagePromise;

				console.log(tl.loc("ExtractingNugetPackage", packageName, unzipLocation));

				var unzipPromise = unzip(zipLocation, unzipLocation);
				unzipPromise.catch((error) => {
					return reject(error)
				});
				await unzipPromise;
				
				if (tl.exist(zipLocation)) {
					tl.rmRF(zipLocation);
				}

				return resolve();
			}
			else {
				return reject(tl.loc("PackageTypeNotSupported"));
			}
		});
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:49,代码来源:download.ts

示例7: run

export async function run(packagingLocation: PackagingLocation, command?: string): Promise<void> {
    const workingDir = tl.getInput(NpmTaskInput.WorkingDir) || process.cwd();
    const npmrc = npmutil.getTempNpmrcPath();
    const npmRegistries: INpmRegistry[] = await getCustomRegistries(packagingLocation);
    const overrideNpmrc = (tl.getInput(NpmTaskInput.CustomRegistry) === RegistryLocation.Feed) ? true : false;

    for (const registry of npmRegistries) {
        if (registry.authOnly === false) {
            tl.debug(tl.loc('UsingRegistry', registry.url));
            npmutil.appendToNpmrc(npmrc, `registry=${registry.url}\n`);
        }

        tl.debug(tl.loc('AddingAuthRegistry', registry.url));
        npmutil.appendToNpmrc(npmrc, `${registry.auth}\n`);
    }

    const npm = new NpmToolRunner(workingDir, npmrc, overrideNpmrc);
    npm.line(command || tl.getInput(NpmTaskInput.CustomCommand, true));

    npm.execSync();

    tl.rmRF(npmrc);
    tl.rmRF(util.getTempPath());
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:24,代码来源:npmcustom.ts

示例8: run

async function run() {
    tl.setResourcePath(path.join(__dirname, 'task.json'));
    let indexFile = path.join(tl.getVariable("SAVE_NPMRC_PATH"), 'index.json');
    if (tl.exist(indexFile)) {
        let indexFileText = fs.readFileSync(indexFile, 'utf8');
        let jsonObject = JSON.parse(indexFileText);
        let npmrcIndex = JSON.stringify(jsonObject[tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile)]);
        util.restoreFileWithName(tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile), npmrcIndex, tl.getVariable("SAVE_NPMRC_PATH"));
        console.log(tl.loc("RevertedChangesToNpmrc", tl.getInput(constants.NpmAuthenticateTaskInput.WorkingFile)));
        if (fs.readdirSync(tl.getVariable("SAVE_NPMRC_PATH")).length == 1) {
            tl.rmRF(tl.getVariable("NPM_AUTHENTICATE_TEMP_DIRECTORY"));
        }
    }
    else {
        console.log(tl.loc("NoIndexJsonFile"));
    }
}
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:17,代码来源:npmauthcleanup.ts

示例9: run

async function run() {
  try {
    if (taskLib.osType() != 'Windows_NT')
      throw new Error('Only Windows systems are supported.');

    const performCleanup: string = taskLib.getVariable('advinst.cleanup');
    taskLib.debug('advinst.cleanup = ' + performCleanup);
    if (!performCleanup) {
      return;
    }

    let licensePath = path.join(taskLib.getVariable('ProgramData'), 'Caphyon\\Advanced Installer\\license80.dat');
    if (taskLib.exist(licensePath)) {
      taskLib.rmRF(licensePath);
    }
  }
  catch (error) {
    taskLib.setResult(taskLib.TaskResult.Failed, error.message);
  }
}
开发者ID:Caphyon,项目名称:advinst-vsts-task,代码行数:20,代码来源:AdvinstTaskCleanup.ts

示例10: reject

	await new Promise<void>(function (resolve, reject) {
		if (tl.exist(unzipLocation)) {
			tl.rmRF(unzipLocation);
		}

		tl.debug('Extracting ' + zipLocation + ' to ' + unzipLocation);

		var unzipper = new DecompressZip(zipLocation);
		unzipper.on('error', err => {
			return reject(tl.loc("ExtractionFailed", err))
		});
		unzipper.on('extract', log => {
			tl.debug('Extracted ' + zipLocation + ' to ' + unzipLocation + ' successfully');
			return resolve();
		});

		unzipper.extract({
			path: unzipLocation
		});
	});
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:20,代码来源:download.ts


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