Skip to content

Commit

Permalink
fix bug on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maruware committed Sep 7, 2020
1 parent 93a7f9f commit 0aff4c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
4 changes: 3 additions & 1 deletion src/s3.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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 }
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==

[email protected]:
version "0.0.4"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35"
Expand Down

0 comments on commit 0aff4c5

Please sign in to comment.