Skip to content

Commit d418f55

Browse files
committed
Ensured tools directory exists
1 parent 7333e3a commit d418f55

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/setup_utilities/workspace-config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,14 @@ export function getToolsDir() {
161161
if (toolsDirFromFile) {
162162
toolsdir = toolsDirFromFile;
163163
}
164-
console.log("Tools directory: " + toolsdir);
165-
console.log("Tools Folder name: " + toolsfoldername);
166-
console.log("Tools directory from config: " + toolsDirFromFile);
167-
console.log("os.home: " + os.homedir());
164+
// Ensure directory exists before returning
165+
try {
166+
if (!fs.pathExistsSync(toolsdir)) {
167+
fs.ensureDirSync(toolsdir);
168+
}
169+
} catch (e) {
170+
console.error("Failed to ensure tools directory exists:", toolsdir, e);
171+
}
168172
return toolsdir;
169173
}
170174

0 commit comments

Comments
 (0)