Skip to content

Commit

Permalink
fix(cli): h5 编译时读取 symbolic link 需要处理相对路径情况,#4538
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Oct 12, 2019
1 parent f021841 commit 425d7b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/taro-cli/src/h5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ class Compiler {
.on('data', file => {
const relativePath = path.relative(appPath, file.path)
if (file.stats.isSymbolicLink()) {
const linkFile = fs.readlinkSync(file.path)
let linkFile = fs.readlinkSync(file.path)
if (!path.isAbsolute(linkFile)) {
linkFile = path.resolve(file.path, '..', linkFile)
}
readFiles.call(this, linkFile, file.path)
} else if (!file.stats.isDirectory()) {
printLog(processTypeEnum.CREATE, '发现文件', relativePath)
Expand Down

0 comments on commit 425d7b6

Please sign in to comment.