mirror of
https://github.com/yawaflua/SpCloudCore.git
synced 2025-12-08 19:49:28 +02:00
Problem with unzip
This commit is contained in:
@@ -15,7 +15,8 @@ private:
|
||||
FileProcessingService file_processing;
|
||||
|
||||
//std::string publish_app_path = "/mnt/c/Users/Danil/SpCloudApp";//Todo change to linux path
|
||||
std::string publish_app_path = "/home/danilt2000/SpCloud/SpCloudApp";//Todo change to linux path
|
||||
//std::string publish_app_path = "/home/danilt2000/SpCloudMain/SpCloudApp";//Todo change to linux path
|
||||
std::string publish_app_path = "/home/danilt2000/SpCloud/";//Todo change to linux path
|
||||
//std::string publish_app_path = "C:/Temps/";// Todo delete if not needed
|
||||
|
||||
public:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
|
||||
class CommandService
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "CommandService.cpp"
|
||||
|
||||
class FileProcessingService
|
||||
@@ -18,6 +18,7 @@ public:
|
||||
std::ofstream ofs(filename, std::ios::binary);
|
||||
if (!ofs) return false;
|
||||
ofs << content;
|
||||
|
||||
return ofs.good();
|
||||
}
|
||||
|
||||
@@ -25,11 +26,13 @@ public:
|
||||
std::filesystem::create_directories(path);
|
||||
}
|
||||
|
||||
|
||||
void unzip(const std::string& file_path, const std::string& final_files_directory) {
|
||||
create_directory(final_files_directory);
|
||||
|
||||
//Windows version
|
||||
//std::string command = R"(powershell -Command "& \"C:\Program Files\WinRAR\WinRAR.exe\" x \")" + file_path + R"(\" \")" + final_files_directory + R"(\")";
|
||||
std::cout << "unzip start\n";
|
||||
|
||||
//Linux version
|
||||
//std::string command = "unzip " + file_path + " -d " + final_files_directory;
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
#include "SpCloudMain.h"
|
||||
#include "httplib.h"
|
||||
|
||||
#include "spdlog.h"
|
||||
#include "basic_file_sink.h"
|
||||
#include "Controllers/PublishController.cpp"
|
||||
//#include "Service/AuthorizationService.cpp"
|
||||
//#include "Service/FileProcessingService.cpp"
|
||||
@@ -14,12 +15,15 @@ using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
std::cout << "SpCloud start\n";
|
||||
|
||||
httplib::Server svr;
|
||||
|
||||
svr.Get("/ping", [](const httplib::Request& req, httplib::Response& res)
|
||||
{
|
||||
std::cout << "Ping-\n";
|
||||
|
||||
res.set_content("Pong", "text/plain");
|
||||
|
||||
httplib::Headers test = req.headers;
|
||||
|
||||
Reference in New Issue
Block a user