Skip to content

Commit

Permalink
Temporary files now deleted before new compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Relfos committed Apr 1, 2018
1 parent 8d3dbda commit 0695c9f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion NEO-Debugger-Core/Utils/DebugManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -704,11 +704,23 @@ public bool CompileContract(string sourceCode, SourceLanguage language, string o
Directory.CreateDirectory(_settings.path);
var fileName = Path.Combine(_settings.path, sourceFile);

var avmPath = fileName.Replace(extension, ".avm");

try
{
File.Delete(avmPath.Replace(".avm", ".abi.json"));
File.Delete(avmPath.Replace(".avm", ".debug.json"));
}
catch
{
// ignore
}

bool success = compiler.CompileContract(sourceCode, fileName, language);

if (success)
{
_avmFilePath = fileName.Replace(extension, ".avm");
_avmFilePath = avmPath;

if (outputFile != null)
{
Expand Down
1 change: 1 addition & 0 deletions NEO-Emulator/ABI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public ABI()
{
var f = new AVMFunction();
f.name = "Main";
f.inputs.Add(new AVMInput() { name = "operation", type = Emulator.Type.String});
f.inputs.Add(new AVMInput() { name = "args", type = Emulator.Type.Array });

this.functions[f.name] = f;
Expand Down

0 comments on commit 0695c9f

Please sign in to comment.