diff --git a/src/cli/utils.js b/src/cli/utils.js index 0c670687e..d6522bf24 100644 --- a/src/cli/utils.js +++ b/src/cli/utils.js @@ -14,10 +14,10 @@ function existsStat() { function getIgnoreList( baseDir ) { - if ( fs.existsSync( `${baseDir}/.gitignore` ) ) { - let gitIgnore = fs.readFileSync( `${baseDir}/.gitignore`, "utf-8" ); - gitIgnore = gitIgnore.trim(); - return gitIgnore.split( "\n" ); + const gitFilePath = path.join( baseDir, ".gitignore" ); + if ( fs.existsSync( gitFilePath ) ) { + const gitIgnore = fs.readFileSync( gitFilePath, "utf-8" ); + return gitIgnore.trim().split( "\n" ); } return []; }