Skip to content

Commit 6cbd899

Browse files
knausj85pokey
andauthored
Use os-specific temp directory for vscode-port (#1)
* Use os-specific temp directory for vscode-port * Use const for path Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: Pokey Rule <[email protected]>
1 parent 0022fa1 commit 6cbd899

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import * as vscode from "vscode";
44
import * as http from "http";
55
import { AddressInfo } from "net";
66
import { writeFileSync } from "fs";
7+
import { tmpdir } from "os";
8+
import { join } from "path";
79

810
interface Command {
911
commandId: string;
@@ -63,7 +65,8 @@ export function activate(context: vscode.ExtensionContext) {
6365
});
6466

6567
function writePort() {
66-
writeFileSync("/tmp/vscode-port", `${port}`);
68+
const path = join(tmpdir(), "vscode-port");
69+
writeFileSync(path, `${port}`);
6770
}
6871
}
6972

0 commit comments

Comments
 (0)