Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit a769750

Browse files
committed
more typos and Paths implementations
1 parent 3300f87 commit a769750

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

UI/MainWindowSPCompiler.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ private async void Compile_SPScripts(bool All = true)
132132
File.Delete(outFile);
133133
}
134134

135-
var errorFile = Environment.CurrentDirectory + @"\sourcepawn\errorfiles\error_" +
136-
Environment.TickCount + "_" + file.GetHashCode().ToString("X") + "_" +
137-
i + ".txt";
135+
var errorFile = $@"{Paths.GetErrorFilesDirectory()}\error_{Environment.TickCount}_{file.GetHashCode():X}_{i}.txt";
138136
if (File.Exists(errorFile))
139137
{
140138
File.Delete(errorFile);
@@ -475,15 +473,13 @@ private string ShortenScriptFileName(string fileName)
475473
private string ExecuteCommandLine(string code, string directory, string copyDir, string scriptFile,
476474
string scriptName, string pluginFile, string pluginName)
477475
{
478-
code = ReplaceCMDVaraibles(code, directory, copyDir, scriptFile, scriptName, pluginFile, pluginName);
476+
code = ReplaceCMDVariables(code, directory, copyDir, scriptFile, scriptName, pluginFile, pluginName);
479477
if (string.IsNullOrWhiteSpace(code))
480478
{
481479
return null;
482480
}
483481

484-
var batchFile = new FileInfo(Path.Combine("sourcepawn\\temp\\",
485-
Environment.TickCount + "_" + ((uint)code.GetHashCode() ^ (uint)directory.GetHashCode()) +
486-
"_temp.bat")).FullName;
482+
var batchFile = new FileInfo(@$"{Paths.GetTempDirectory()}\{Environment.TickCount}_{(uint)code.GetHashCode() ^ (uint)directory.GetHashCode()}_temp.bat").FullName;
487483
File.WriteAllText(batchFile, code);
488484
string result;
489485
using (var process = new Process())

0 commit comments

Comments
 (0)