Only avoid collision if it's the same file

@chriseth had suggested that it would be better if contracts were
referenced in a file:contract notation, and that we output .bin files
that prepend original path names if necessary to avoid a collision.

This commit is mostly a draft; it still needs to be run through the test
suite.
This commit is contained in:
Rhett Aultman
2017-01-16 12:32:57 -05:00
committed by Rhett Aultman
parent 9e88f1eebe
commit 071b936b37
5 changed files with 52 additions and 14 deletions
+4 -2
View File
@@ -185,8 +185,10 @@ void CommandLineInterface::handleBinary(string const& _contract)
{
if (m_args.count(g_argBinary))
{
if (m_args.count(g_argOutputDir))
createFile(_contract + ".bin", m_compiler->object(_contract).toHex());
if (m_args.count("output-dir"))
{
createFile(m_compiler->filesystemFriendlyName(_contract) + ".bin", m_compiler->object(_contract).toHex());
}
else
{
cout << "Binary: " << endl;