mirror of https://github.com/AxioDL/metaforce.git
Implement -o flag for extracting
This commit is contained in:
parent
f57e086e57
commit
eb1803aa0f
|
@ -35,22 +35,35 @@ public:
|
||||||
|
|
||||||
if (!info.project)
|
if (!info.project)
|
||||||
{
|
{
|
||||||
/* Get name from input file and init project there */
|
hecl::SystemString rootDir;
|
||||||
hecl::SystemString baseFile = info.args.front();
|
|
||||||
size_t slashPos = baseFile.rfind(_S('/'));
|
|
||||||
if (slashPos == hecl::SystemString::npos)
|
|
||||||
slashPos = baseFile.rfind(_S('\\'));
|
|
||||||
if (slashPos != hecl::SystemString::npos)
|
|
||||||
baseFile.assign(baseFile.begin() + slashPos + 1, baseFile.end());
|
|
||||||
size_t dotPos = baseFile.rfind(_S('.'));
|
|
||||||
if (dotPos != hecl::SystemString::npos)
|
|
||||||
baseFile.assign(baseFile.begin(), baseFile.begin() + dotPos);
|
|
||||||
|
|
||||||
if (baseFile.empty())
|
if (info.output.empty())
|
||||||
LogModule.report(logvisor::Fatal, "hecl extract must be ran within a project directory");
|
{
|
||||||
|
/* Get name from input file and init project there */
|
||||||
|
hecl::SystemString baseFile = info.args.front();
|
||||||
|
size_t slashPos = baseFile.rfind(_S('/'));
|
||||||
|
if (slashPos == hecl::SystemString::npos)
|
||||||
|
slashPos = baseFile.rfind(_S('\\'));
|
||||||
|
if (slashPos != hecl::SystemString::npos)
|
||||||
|
baseFile.assign(baseFile.begin() + slashPos + 1, baseFile.end());
|
||||||
|
size_t dotPos = baseFile.rfind(_S('.'));
|
||||||
|
if (dotPos != hecl::SystemString::npos)
|
||||||
|
baseFile.assign(baseFile.begin(), baseFile.begin() + dotPos);
|
||||||
|
|
||||||
|
if (baseFile.empty())
|
||||||
|
LogModule.report(logvisor::Fatal, "hecl extract must be ran within a project directory");
|
||||||
|
|
||||||
|
rootDir = info.cwd + baseFile;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (hecl::PathRelative(info.output.c_str()))
|
||||||
|
rootDir = info.cwd + info.output;
|
||||||
|
else
|
||||||
|
rootDir = info.output;
|
||||||
|
}
|
||||||
|
|
||||||
size_t ErrorRef = logvisor::ErrorCount;
|
size_t ErrorRef = logvisor::ErrorCount;
|
||||||
hecl::SystemString rootDir = info.cwd + baseFile;
|
|
||||||
hecl::ProjectRootPath newProjRoot(rootDir);
|
hecl::ProjectRootPath newProjRoot(rootDir);
|
||||||
newProjRoot.makeDir();
|
newProjRoot.makeDir();
|
||||||
m_fallbackProj.reset(new hecl::Database::Project(newProjRoot));
|
m_fallbackProj.reset(new hecl::Database::Project(newProjRoot));
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 87f213bc0bba888eeea4e614162a8b3b918bcbf8
|
Subproject commit ec49377fcd20748ae4490cd18afc9abefa11e7be
|
Loading…
Reference in New Issue