Skip to content

Commit

Permalink
revert: refactor to get whole file path
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowtime2000 committed Dec 5, 2020
1 parent b576e7c commit 317513b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ import type { EtaConfig } from './config'
*/

function getWholeFilePath(name: string, parentfile: string, isDirectory?: boolean): string {
const includePath =
path.resolve(isDirectory ? parentfile : path.dirname(parentfile)) +
(path.extname(name) || '.eta')
let includePath = path.resolve(
isDirectory ? parentfile : path.dirname(parentfile), // returns directory the parent file is in
name // file
)
const ext = path.extname(name)
if (!ext) {
includePath += '.eta'
}
return includePath
}

Expand Down

0 comments on commit 317513b

Please sign in to comment.