mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
allow reading images from the current directory in the CLI interface
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1475 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+10
-2
@@ -26,8 +26,8 @@ CLISetInterface::CLISetInterface(const SetP& set, bool quiet)
|
||||
if (!cli.haveConsole()) {
|
||||
throw Error(_("Can not run command line interface without a console;\nstart MSE with \"mse.com --cli\""));
|
||||
}
|
||||
ei.directory_relative = ei.directory_absolute = wxGetCwd();
|
||||
ei.allow_writes_outside = true;
|
||||
setExportInfoCwd();
|
||||
setSet(set);
|
||||
run();
|
||||
}
|
||||
@@ -61,6 +61,14 @@ void CLISetInterface::onChangeSet() {
|
||||
ei.set = set;
|
||||
}
|
||||
|
||||
void CLISetInterface::setExportInfoCwd() {
|
||||
// write to the current directory
|
||||
ei.directory_relative = ei.directory_absolute = wxGetCwd();
|
||||
// read from the current directory
|
||||
ei.export_template = intrusive(new Package());
|
||||
ei.export_template->open(ei.directory_absolute, true);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : Running
|
||||
|
||||
@@ -151,7 +159,7 @@ void CLISetInterface::handleCommand(const String& command) {
|
||||
if (!wxSetWorkingDirectory(arg)) {
|
||||
cli.showError(_("Can't change working directory to ")+arg);
|
||||
} else {
|
||||
ei.directory_relative = ei.directory_absolute = wxGetCwd();
|
||||
setExportInfoCwd();
|
||||
}
|
||||
}
|
||||
} else if (before == _(":pwd") || before == _(":p")) {
|
||||
|
||||
Reference in New Issue
Block a user