We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9960eb9 commit 59871cbCopy full SHA for 59871cb
1 file changed
packages/contentstack-utilities/src/logger/log.ts
@@ -86,8 +86,10 @@ function getLogPath(): string {
86
// 3. Use current working directory (where user ran the command)
87
try {
88
const cwdPath = path.join(process.cwd(), 'logs');
89
- const testDir = path.dirname(cwdPath);
90
- fs.accessSync(testDir, fs.constants.W_OK);
+ if (!fs.existsSync(cwdPath)) {
+ fs.mkdirSync(cwdPath, { recursive: true });
91
+ }
92
+ fs.accessSync(cwdPath, fs.constants.W_OK);
93
return cwdPath;
94
} catch (error) {
95
// If current directory is not writable, fall back to home directory
0 commit comments