diff --git a/Tasks/DownloadBuildArtifactsV0/Strings/resources.resjson/en-US/resources.resjson b/Tasks/DownloadBuildArtifactsV0/Strings/resources.resjson/en-US/resources.resjson index 559d1f886c0b..075bee42b259 100644 --- a/Tasks/DownloadBuildArtifactsV0/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/DownloadBuildArtifactsV0/Strings/resources.resjson/en-US/resources.resjson @@ -42,5 +42,6 @@ "loc.messages.ArtifactNameDirectoryNotFound": "Directory '%s' does not exist. Falling back to parent directory: %s", "loc.messages.LatestBuildFound": "Latest build found: %s", "loc.messages.LatestBuildNotFound": "Latest build not found", - "loc.messages.LatestBuildFromBranchNotFound": "Latest build from branch %s not found" + "loc.messages.LatestBuildFromBranchNotFound": "Latest build from branch %s not found", + "loc.messages.DownloadingContainerResource": "Downloading items from container resource %s" } \ No newline at end of file diff --git a/Tasks/DownloadBuildArtifactsV0/main.ts b/Tasks/DownloadBuildArtifactsV0/main.ts index 4a48bd28c609..3631e5b38639 100644 --- a/Tasks/DownloadBuildArtifactsV0/main.ts +++ b/Tasks/DownloadBuildArtifactsV0/main.ts @@ -225,13 +225,16 @@ async function main(): Promise { if (artifact.resource.type.toLowerCase() === "container") { let downloader = new engine.ArtifactEngine(); - var containerParts: string[] = artifact.resource.data.split('/', 3); - if (containerParts.length !== 3) { + + console.log(tl.loc("DownloadingContainerResource", artifact.resource.data)); + var containerParts = artifact.resource.data.split('/'); + + if (containerParts.length < 3) { throw new Error(tl.loc("FileContainerInvalidArtifactData")); } - - var containerId: number = parseInt(containerParts[1]); - var containerPath: string = containerParts[2]; + + var containerId = parseInt(containerParts[1]); + var containerPath = containerParts.slice(2,containerParts.length).join('/'); var itemsUrl = endpointUrl + "/_apis/resources/Containers/" + containerId + "?itemPath=" + encodeURIComponent(containerPath) + "&isShallow=true&api-version=4.1-preview.4"; console.log(tl.loc("DownloadArtifacts", artifact.name, itemsUrl)); diff --git a/Tasks/DownloadBuildArtifactsV0/task.json b/Tasks/DownloadBuildArtifactsV0/task.json index 97696f51bc00..378835b65b91 100644 --- a/Tasks/DownloadBuildArtifactsV0/task.json +++ b/Tasks/DownloadBuildArtifactsV0/task.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 136, - "Patch": 4 + "Patch": 5 }, "groups": [ { @@ -228,6 +228,7 @@ "ArtifactNameDirectoryNotFound": "Directory '%s' does not exist. Falling back to parent directory: %s", "LatestBuildFound": "Latest build found: %s", "LatestBuildNotFound":"Latest build not found", - "LatestBuildFromBranchNotFound":"Latest build from branch %s not found" + "LatestBuildFromBranchNotFound":"Latest build from branch %s not found", + "DownloadingContainerResource": "Downloading items from container resource %s" } } diff --git a/Tasks/DownloadBuildArtifactsV0/task.loc.json b/Tasks/DownloadBuildArtifactsV0/task.loc.json index 52f7c416a961..743573f7ba48 100644 --- a/Tasks/DownloadBuildArtifactsV0/task.loc.json +++ b/Tasks/DownloadBuildArtifactsV0/task.loc.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 136, - "Patch": 4 + "Patch": 5 }, "groups": [ { @@ -228,6 +228,7 @@ "ArtifactNameDirectoryNotFound": "ms-resource:loc.messages.ArtifactNameDirectoryNotFound", "LatestBuildFound": "ms-resource:loc.messages.LatestBuildFound", "LatestBuildNotFound": "ms-resource:loc.messages.LatestBuildNotFound", - "LatestBuildFromBranchNotFound": "ms-resource:loc.messages.LatestBuildFromBranchNotFound" + "LatestBuildFromBranchNotFound": "ms-resource:loc.messages.LatestBuildFromBranchNotFound", + "DownloadingContainerResource": "ms-resource:loc.messages.DownloadingContainerResource" } } \ No newline at end of file