本文整理匯總了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);
}
}