Skip to content

Commit

Permalink
make sure XDG_RUNTIME_DIR exists (#555)
Browse files Browse the repository at this point in the history
* make sure XDG_RUNTIME_DIR exists

* update changelog
  • Loading branch information
gcampbell-msft authored Jan 23, 2024
1 parent 9ac0790 commit 2ff3d25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# What's New?

## 0.9
Bug Fixes:

- Fix an issue with XDG_RUNTIME_DIR where we tried to reference the directory, but it didn't exist. [#553](https://github.com/microsoft/vscode-makefile-tools/pull/555)

## 0.8
Bug Fixes:
- Fix a bug where the first argument for pre/post-configure args didn't have the proper spacing in front of it [PR #530](https://github.com/microsoft/vscode-makefile-tools/pull/530)
Expand Down
9 changes: 8 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ export function tmpDir(): string {
if (process.platform === 'win32') {
return process.env['TEMP'] || "";
} else {
return process.env['XDG_RUNTIME_DIR'] || '/tmp';
const xdg = process.env['XDG_RUNTIME_DIR'];
if (xdg) {
if (!fs.existsSync(xdg)) {
fs.mkdirSync(xdg);
}
return xdg;
}
return '/tmp';
}
}

Expand Down

0 comments on commit 2ff3d25

Please sign in to comment.