3 #include <Strings/components/utils/io/io.h>
4 #include <Strings/components/utils/string/string.h>
5 #include <Strings/components/utils/converters/converters.h>
6 #include <Strings/components/logger/logger.h>
8 #include <HEKGuerilla/components/tags/importers/bitmap/bitmap.h>
9 #include <HEKGuerilla/components/tags/tags.h>
10 #include <HEKGuerilla/components/settings/config/config.h>
12 #include "../ToolCommand.hpp"
13 #include "../console.h"
15 #ifdef TOOL_LIB_EXPORTS
16 #define TOOL_LIB_API __declspec(dllexport)
18 #define TOOL_LIB_API __declspec(dllimport)
33 syntax =
"set-project [dir]";
34 description =
"instructs tool to use a custom directory for all commands. if set, then all commands run will use the "
35 "specified directory when checking data, tags, and other content folders. if left blank, then any existing path "
36 "will be cleared, and the application directory will be used instead.";
39 int execute(std::vector<std::string> args)
43 BlamStrings::Logger::LogEvent(
"not enough arguments provided - you must specify a project root directory", WSV_WARNING);
47 if (!BlamStrings::Utils::IO::IsDirectory(args[0]))
49 BlamStrings::Logger::LogEvent(
"specified path '" + args[0] +
"' does not exist, or is not a directory", WSV_WARNING);
53 std::string dir = BlamStrings::Utils::IO::GetAbsolutePathFromRelative(args[0]);
55 if (BlamStrings::Utils::IO::CreateNewFile(
".TOOL_PROJECT_ROOT", dir))
57 BlamStrings::Logger::LogEvent(
"successfully set project root to '" + dir +
"'");
61 BlamStrings::Logger::LogEvent(
"could not change project root: CreateNewFile() returned false", WSV_WARNING);