Skip to content

Commit

Permalink
refactor: 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 94a19e1 commit c7bba26
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/file-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ import type { EtaConfig } from './config'
*/

function getWholeFilePath(name: string, parentfile: string, isDirectory?: boolean): string {
let includePath = path.resolve(
const 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'
}
) + (path.extname(name) ? '' : '.eta')
return includePath
}

Expand Down

0 comments on commit c7bba26

Please sign in to comment.