Skip to content

Commit d2c5ec2

Browse files
Fix.
1 parent 4bfe4eb commit d2c5ec2

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

app/exec/build/tasks/upload.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
4040
}
4141

4242
if (taskZipPath) {
43+
//var readStream = fs.createReadStream(taskZipPath);
44+
4345
// User provided an already zipped task, upload that.
4446
const data: Buffer = fs.readFileSync(taskZipPath);
47+
console.log(`initial file buffer size: ${data.byteLength}`);
4548
const z: zip = await zip.loadAsync(data);
4649

4750
// find task.json inside zip, make sure its there then deserialize content
@@ -50,7 +53,14 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
5053

5154
sourceLocation = taskZipPath;
5255
taskId = taskJson.id;
53-
taskStream = z.generateNodeStream();
56+
//taskStream = z.generateNodeStream();
57+
taskStream = fs.createReadStream(taskZipPath);
58+
59+
// console.log('writing new stream to file');
60+
// const reloadedZip: string = 'D:\\reloaded.zip';
61+
// fs.writeFileSync(reloadedZip, taskStream);
62+
// const reloadedData = fs.readFileSync(reloadedZip);
63+
// console.log(`reloaded file buffer size: ${reloadedData.byteLength}`);
5464
} else {
5565
// User provided the path to a directory with the task content
5666
const taskPath: string = taskPaths[0];
@@ -77,6 +87,9 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
7787
trace.info("Collection URL: " + collectionUrl);
7888
const agentApi: ITaskAgentApi = await this.webApi.getTaskAgentApi(collectionUrl);
7989

90+
// console.log('returning early');
91+
// return <agentContracts.TaskDefinition> { sourceLocation: sourceLocation, };
92+
8093
await agentApi.uploadTaskDefinition(null, taskStream, taskId, overwrite);
8194
trace.debug("Success");
8295
return <agentContracts.TaskDefinition> { sourceLocation: sourceLocation, };

0 commit comments

Comments
 (0)