@@ -40,8 +40,11 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
40
40
}
41
41
42
42
if ( taskZipPath ) {
43
+ //var readStream = fs.createReadStream(taskZipPath);
44
+
43
45
// User provided an already zipped task, upload that.
44
46
const data : Buffer = fs . readFileSync ( taskZipPath ) ;
47
+ console . log ( `initial file buffer size: ${ data . byteLength } ` ) ;
45
48
const z : zip = await zip . loadAsync ( data ) ;
46
49
47
50
// find task.json inside zip, make sure its there then deserialize content
@@ -50,7 +53,14 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
50
53
51
54
sourceLocation = taskZipPath ;
52
55
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}`);
54
64
} else {
55
65
// User provided the path to a directory with the task content
56
66
const taskPath : string = taskPaths [ 0 ] ;
@@ -77,6 +87,9 @@ export class BuildTaskUpload extends tasksBase.BuildTaskBase<agentContracts.Task
77
87
trace . info ( "Collection URL: " + collectionUrl ) ;
78
88
const agentApi : ITaskAgentApi = await this . webApi . getTaskAgentApi ( collectionUrl ) ;
79
89
90
+ // console.log('returning early');
91
+ // return <agentContracts.TaskDefinition> { sourceLocation: sourceLocation, };
92
+
80
93
await agentApi . uploadTaskDefinition ( null , taskStream , taskId , overwrite ) ;
81
94
trace . debug ( "Success" ) ;
82
95
return < agentContracts . TaskDefinition > { sourceLocation : sourceLocation , } ;
0 commit comments