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


TypeScript shelljs.cp函數代碼示例

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


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

示例1: it

    it('codecoverage.publish : publish code coverage files with additional files having same file name', function(done) {
        this.timeout(2000);
        var additionalFileDirectory = path.join(shell.tempdir(), "files");
        var duplicateDirectory = path.join(additionalFileDirectory, "duplicate");
        shell.mkdir('-p', additionalFileDirectory);
        shell.mkdir('-p', duplicateDirectory);
        shell.cp('-f', path.resolve(__dirname, './codecoveragefiles/jacoco.xml'), additionalFileDirectory);
        shell.cp('-f', path.resolve(__dirname, './codecoveragefiles/jacoco.xml'), duplicateDirectory);

        var properties: { [name: string]: string } = { "summaryfile": coberturaSummaryFile, "codecoveragetool": "Cobertura", "reportdirectory": "", "additionalcodecoveragefiles": path.join(additionalFileDirectory, "jacoco.xml") + "," + path.join(duplicateDirectory, "jacoco.xml") };
        var command: cm.ITaskCommand = new tc.TestCommand(null, null, null);
        command.properties = properties;
        var coberturaSummaryReader = new csr.CoberturaSummaryReader(command);
        var jobInfo = new jobInf.TestJobInfo({});
        jobInfo.variables = { "agent.workingDirectory": __dirname, "build.buildId": "1" };
        testExecutionContext = new tec.TestExecutionContext(jobInfo);

        var codeCoveragePublishCommand = new cpc.CodeCoveragePublishCommand(testExecutionContext, command);
        codeCoveragePublishCommand.runCommandAsync().then(function(result) {
            assert(testExecutionContext.service.jobsCompletedSuccessfully(), 'CodeCoveragePublish Task Failed! Details : ' + testExecutionContext.service.getRecordsString());
            assert(testExecutionContext.service.containerItems.length == 3);
            assert(testExecutionContext.service.artifactNames.length == 2);
            assert(testExecutionContext.service.artifactNames[0] == "Code Coverage Report_1");
            assert(testExecutionContext.service.artifactNames[1] == "Code Coverage Files_1");
            assert(result);
            done();
        },
            function(err) {
                assert(false, 'CodeCoveragePublish Task Failed! Details : ' + err.message);
                done();
            });
    })
開發者ID:IvyMH,項目名稱:vso-agent,代碼行數:32,代碼來源:publishcodecoveragetests.ts

示例2: copyAssets

export function copyAssets(env: BuildEnv): void {
    signale.await('Copy assets')
    const dir = 'build/dist'
    shelljs.rm('-rf', dir)
    shelljs.mkdir('-p', dir)
    shelljs.cp('-R', 'src/extension/assets/*', dir)
    shelljs.cp('-R', 'src/extension/views/*', dir)
    signale.success('Assets copied')
}
開發者ID:JoYiRis,項目名稱:sourcegraph,代碼行數:9,代碼來源:tasks.ts

示例3: Given

Given('my workspace contains an image {string}', function(imageName) {
  mkdirp.sync(path.join(this.rootDir, path.dirname(imageName)))
  cp(
    path.join(__dirname, path.basename(imageName)),
    path.join(this.rootDir, imageName)
  )
})
開發者ID:Originate,項目名稱:tutorial-runner,代碼行數:7,代碼來源:given-steps.ts

示例4: transferDirectory

	public async transferDirectory(deviceAppData: Mobile.IDeviceAppData, localToDevicePaths: Mobile.ILocalToDevicePathData[], projectFilesPath: string): Promise<Mobile.ILocalToDevicePathData[]> {
		const destinationPath = await deviceAppData.getDeviceProjectRootPath();
		this.$logger.trace(`Transferring from ${projectFilesPath} to ${destinationPath}`);
		const sourcePath = path.join(projectFilesPath, "*");
		shelljs.cp("-Rf", sourcePath, destinationPath);
		return localToDevicePaths;
	}
開發者ID:NativeScript,項目名稱:nativescript-cli,代碼行數:7,代碼來源:ios-simulator-file-system.ts

示例5: function

		function(dir) {
			if(dir) {
				console.log(`extracting ${dir}`);
				// copy the filtered directory into the target directory
				sh.cp('-R', dir, targetDir);
			}
		}
開發者ID:htammen,項目名稱:sapui5_sources_extract,代碼行數:7,代碼來源:create_js_resources.ts

示例6: copyTemplate

function copyTemplate(sourcearr, folderarr) {
    for (let target of folderarr) {
        for (let source of sourcearr) {
            shell.cp('-f', source, target);
        }
    }
}
開發者ID:goumang2010,項目名稱:NetTxtNote,代碼行數:7,代碼來源:_copy.ts

示例7: relative

 bundle.src.program.getSourceFiles().forEach(sourceFile => {
   if (!sourceFile.isDeclarationFile) {
     const relativePath = relative(entryPointPath, sourceFile.fileName);
     const newFilePath = join(newDir, relativePath);
     mkdir('-p', dirname(newFilePath));
     cp(sourceFile.fileName, newFilePath);
   }
 });
開發者ID:alxhub,項目名稱:angular,代碼行數:8,代碼來源:new_entry_point_file_writer.ts

示例8: return

		return (() => {
			this.$logger.trace(`Transferring from ${localFilePath} to ${deviceFilePath}`);
			if (this.$fs.getFsStats(localFilePath).wait().isDirectory()) {
				shelljs.mkdir(deviceFilePath);
			} else {
				shelljs.cp("-f", localFilePath, deviceFilePath);
			}
		}).future<void>()();
開發者ID:enchev,項目名稱:mobile-cli-lib,代碼行數:8,代碼來源:ios-simulator-file-system.ts

示例9: function

var overwriteFile = function(src, dest) {
	console.log('writing: ' + dest);
	if (shell.test('-f', dest)) {
		shell.rm('-f', dest);
	}

	shell.cp(src, dest);
}
開發者ID:ElleCox,項目名稱:vso-agent,代碼行數:8,代碼來源:installer.ts

示例10: transferFile

	public async transferFile(localFilePath: string, deviceFilePath: string): Promise<void> {
		this.$logger.trace(`Transferring from ${localFilePath} to ${deviceFilePath}`);
		if (this.$fs.getFsStats(localFilePath).isDirectory()) {
			this.$fs.ensureDirectoryExists(deviceFilePath);
		} else {
			this.$fs.ensureDirectoryExists(path.dirname(deviceFilePath));
			shelljs.cp("-f", localFilePath, deviceFilePath);
		}
	}
開發者ID:NativeScript,項目名稱:nativescript-cli,代碼行數:9,代碼來源:ios-simulator-file-system.ts


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