Skip to content

Commit 468b15f

Browse files
committed
fix: getConfig and node_moules/ exclusion
1 parent 6b936f9 commit 468b15f

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/commands/upload.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = async function upload(directory, args) {
3232
if (config) {
3333
await file(config, configPath, filePath)
3434
} else {
35-
console.log('Failed to read or parse CoCreate.config.js.');
35+
console.log(`Failed to read or parse CoCreate.config.js for file: ${filename}`);
3636
}
3737
}
3838
});
@@ -69,17 +69,18 @@ module.exports = async function upload(directory, args) {
6969
}
7070

7171
async function getConfig(directory, filename = '') {
72+
let config, configPath
7273
const filePath = path.resolve(directory, filename);
73-
if (!filePath.includes('node_modules')) {
74-
const configPath = findClosestConfig(filePath)
74+
if (!filePath.includes('node_modules/')) {
75+
configPath = findClosestConfig(filePath)
7576
if (configPath) {
76-
return { config: require(configPath), configPath, filePath };
77-
77+
config = require(configPath)
7878
} else {
7979
console.log('No CoCreate.config file found in parent directories.');
8080
}
8181
}
8282

83+
return { config, configPath, filePath };
8384
}
8485

8586
function findClosestConfig(filePath) {

0 commit comments

Comments
 (0)