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