mirror of
https://github.com/aimrebirth/tools.git
synced 2026-04-15 01:43:25 +00:00
Initial mod activator.
This commit is contained in:
parent
9d77576607
commit
8f8a49791a
2 changed files with 45 additions and 0 deletions
42
src/aim1_mod_activator/mod_activator.cpp
Normal file
42
src/aim1_mod_activator/mod_activator.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* AIM mod_activator
|
||||
* Copyright (C) 2024 lzwdgc
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <primitives/pack.h>
|
||||
#include <primitives/sw/main.h>
|
||||
#include <primitives/sw/cl.h>
|
||||
|
||||
void activate(auto &&fn) {
|
||||
// files will get new timestamp automatically
|
||||
// our unpack_file() does not preserve timestamps
|
||||
unpack_file(fn, fs::current_path());
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
cl::opt<path> p(cl::Positional, cl::desc("<mod .zip archive>"), cl::value_desc("file"), cl::Required);
|
||||
|
||||
cl::ParseCommandLineOptions(argc, argv);
|
||||
|
||||
if (fs::is_regular_file(p)) {
|
||||
activate(p);
|
||||
} else {
|
||||
throw std::runtime_error("Bad fs object");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
3
sw.cpp
3
sw.cpp
|
|
@ -76,6 +76,9 @@ void build(Solution &s)
|
|||
;
|
||||
}
|
||||
|
||||
auto &aim1_mod_activator = add_exe_with_common("aim1_mod_activator");
|
||||
aim1_mod_activator += "pub.egorpugin.primitives.pack"_dep;
|
||||
|
||||
auto &aim1_mod_maker = add_exe_with_common("aim1_mod_maker"); // actually a library
|
||||
aim1_mod_maker.Public += "pub.egorpugin.primitives.command"_dep;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue