fix: better temp dir management
This commit is contained in:
parent
e956744517
commit
6f78cab411
2 changed files with 3 additions and 2 deletions
|
@ -35,7 +35,7 @@ public abstract class ZigDebugParametersEmitBinaryBase<ProfileState extends Prof
|
||||||
val commandLine = profileState.getCommandLine(toolchain, true);
|
val commandLine = profileState.getCommandLine(toolchain, true);
|
||||||
final Path tmpDir;
|
final Path tmpDir;
|
||||||
try {
|
try {
|
||||||
tmpDir = Files.createTempDirectory("zigbrains_debug").toAbsolutePath();
|
tmpDir = FileUtil.createTempDirectory("zigbrains_debug", "", true).toPath();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ExecutionException("Failed to create temporary directory for " + kind + " binary", e);
|
throw new ExecutionException("Failed to create temporary directory for " + kind + " binary", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ import com.intellij.openapi.application.ApplicationManager;
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.startup.ProjectActivity;
|
import com.intellij.openapi.startup.ProjectActivity;
|
||||||
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import kotlin.coroutines.Continuation;
|
import kotlin.coroutines.Continuation;
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
|
@ -75,7 +76,7 @@ public class ZLSStartupActivity implements ProjectActivity {
|
||||||
if (configPath == null || configPath.isBlank()) {
|
if (configPath == null || configPath.isBlank()) {
|
||||||
blk:
|
blk:
|
||||||
try {
|
try {
|
||||||
val tmpFile = Files.createTempFile("zigbrains-zls-autoconf", ".json");
|
val tmpFile = FileUtil.createTempFile("zigbrains-zls-autoconf", ".json", true).toPath();
|
||||||
val config = ZLSConfigProvider.findEnvironment(project);
|
val config = ZLSConfigProvider.findEnvironment(project);
|
||||||
if (StringUtil.isEmpty(config.zig_exe_path()) && StringUtil.isEmpty(config.zig_lib_path())) {
|
if (StringUtil.isEmpty(config.zig_exe_path()) && StringUtil.isEmpty(config.zig_lib_path())) {
|
||||||
// TODO this generates unnecessary noise in non-zig projects, find an alternative.
|
// TODO this generates unnecessary noise in non-zig projects, find an alternative.
|
||||||
|
|
Loading…
Add table
Reference in a new issue