Skip to content

Commit

Permalink
fix(cli): 更正 UI 库编译提示
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Aug 16, 2018
1 parent 819a6cc commit fb71d60
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions packages/taro-cli/src/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,25 @@ async function buildForWeapp () {
}
try {
const outputDir = path.join(appPath, outputDirName, weappOutputName)
klaw(sourceDir)
.on('data', file => {
const relativePath = path.relative(appPath, file.path)
if (!file.stats.isDirectory()) {
printLog(pocessTypeEnum.CREATE, '发现文件', relativePath)
const dirname = path.dirname(file.path)
const distDirname = dirname.replace(sourceDir, outputDir)
fs.ensureDirSync(distDirname)
fs.copyFileSync(file.path, path.format({
dir: distDirname,
base: path.basename(file.path)
}))
}
})
await new Promise(resolve => {
klaw(sourceDir)
.on('data', file => {
const relativePath = path.relative(appPath, file.path)
if (!file.stats.isDirectory()) {
printLog(pocessTypeEnum.COPY, '发现文件', relativePath)
const dirname = path.dirname(file.path)
const distDirname = dirname.replace(sourceDir, outputDir)
fs.ensureDirSync(distDirname)
fs.copyFileSync(file.path, path.format({
dir: distDirname,
base: path.basename(file.path)
}))
}
})
.on('end', () => {
resolve()
})
})
} catch (err) {
console.log(err)
}
Expand Down

0 comments on commit fb71d60

Please sign in to comment.