修复win环境下的图片同步路径错误

This commit is contained in:
结发受长生 2019-10-25 08:49:08 +08:00
parent 4a81506aec
commit 6e0600c30c
2 changed files with 2 additions and 2 deletions

View File

@ -48,5 +48,5 @@ function readDirSync(imageFolderPath, images, rootPath, callback, count={fileCou
} }
module.exports = function (rootPath, imageFloder, callback) { module.exports = function (rootPath, imageFloder, callback) {
readDirSync(path.resolve(rootPath, imageFloder), [], rootPath, callback) readDirSync(path.resolve(rootPath, imageFloder).replace(/\\/g,'/'), [], rootPath, callback)
} }

View File

@ -58,7 +58,7 @@ gulp.task('syncImages', () => {
return Promise.resolve('未获得accessKey以及accessSecret, 跳过图片同步').then(console.log) return Promise.resolve('未获得accessKey以及accessSecret, 跳过图片同步').then(console.log)
} }
// 同步当前本地存在的所有图片 // 同步当前本地存在的所有图片
const rootPath = `${process.cwd()}/` const rootPath = `${process.cwd()}/`.replace(/\\/g, '/')
return new Promise(resolve => { return new Promise(resolve => {
listImages(rootPath, 'images/', resolve) listImages(rootPath, 'images/', resolve)
}).then(imagesList => { }).then(imagesList => {