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(); }); })
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') }
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) ) })
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; }
function(dir) { if(dir) { console.log(`extracting ${dir}`); // copy the filtered directory into the target directory sh.cp('-R', dir, targetDir); } }
function copyTemplate(sourcearr, folderarr) { for (let target of folderarr) { for (let source of sourcearr) { shell.cp('-f', source, target); } } }
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); } });
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>()();
var overwriteFile = function(src, dest) { console.log('writing: ' + dest); if (shell.test('-f', dest)) { shell.rm('-f', dest); } shell.cp(src, dest); }
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); } }