-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
31 lines (29 loc) · 866 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include "src/Config.h"
#include "src/Site.h"
#include "src/Logger.h"
#include "src/Server.h"
extern Config *config;
int main(int argc, char *argv[])
{
config = new Config(argc, argv);
Logger::debug("Starting BlueSky...");
Logger::debug("Input directory: " + config->get_input_dir());
Logger::debug("Output directory: " + config->get_output_dir());
Logger::debug("Verbose: " + std::to_string(config->is_verbose()));
Logger::debug("Serve: " + std::to_string(config->is_serve()));
Logger::debug("Building site...");
Site site(config->get_input_dir());
if (config->is_serve())
{
Logger::debug("Serving site...");
Server server(site, config->get_serve_ip());
server.run();
}
else
{
Logger::debug("Writing site...");
site.write();
}
delete config;
}