Skip to content

Commit 281092b

Browse files
committed
Avoid slashes in the cacheId
We will use the `cacheId` as a file name of the `.zip` that we will cache when writing to a non-empty output directory. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 3ad04cd commit 281092b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

__tests__/downloader.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ test('can obtain build ID', async () => {
5656
undefined
5757
)
5858
expect(fetch).toHaveBeenCalledTimes(1)
59-
expect(cacheId).toEqual('git-for-windows/git-22-git-sdk-64-minimal-71000')
59+
expect(cacheId).toEqual('git-for-windows.git-22-git-sdk-64-minimal-71000')
6060
})

src/downloader.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ export async function get(
187187
}
188188
}
189189

190-
const cacheId = `${repository}-${definitionId}-${artifactName}-${data.value[0].id}`
190+
const cacheId = `${repository}-${definitionId}-${artifactName}-${data.value[0].id}`.replace(
191+
'/',
192+
'.'
193+
)
191194
return {artifactName, stripPrefix, download, cacheId}
192195
}

0 commit comments

Comments
 (0)