diff --git a/package.json b/package.json index 9f3f254..8a1c0ff 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "glob": "^7.1.6", "listr": "^0.14.3", "lodash.keyby": "^4.6.0", - "mime-types": "^2.1.25" + "mime-types": "^2.1.25", + "slash": "^3.0.0" } } diff --git a/src/s3.ts b/src/s3.ts index ab70bc4..09bf218 100644 --- a/src/s3.ts +++ b/src/s3.ts @@ -1,6 +1,7 @@ import glob from 'glob' import { promisify } from 'util' import { join, relative } from 'path' +import slash from 'slash' import Listr, { ListrTask } from 'listr' import { S3 } from 'aws-sdk' import { createReadStream, lstatSync } from 'fs' @@ -12,7 +13,8 @@ import { getContentType } from './utils/mime' const globAsync = promisify(glob) const resolveObjectKey = (cwd: string, base: string, filename: string) => { - return relative(join(cwd, base), filename) + const p = relative(join(cwd, base), filename) + return slash(p) } type FileDef = { name: string; key: string; md5: string } diff --git a/yarn.lock b/yarn.lock index 5c3eeba..71759d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3863,6 +3863,11 @@ slash@^2.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"