Runtime: reset stale Core baseline on upgrade
This commit is contained in:
1 parent
978930f4d2
commit
2fba7d2dea
5 files changed
+310
-31
No files matched your search
@@ -1,6 +1,7 @@
|
||||
#include "echoion/host/CoreLoader.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
@@ -34,11 +35,17 @@ int main()
|
||||
::setenv("HOME", root.c_str(), 1);
|
||||
const auto stateDirectory = root / "runtime-state";
|
||||
::setenv("ECHOION_STATE_DIR", stateDirectory.c_str(), 1);
|
||||
const auto ytDlp = root / ".local/share/echoion/yt-dlp/yt-dlp";
|
||||
const auto dataDirectory = stateDirectory / "data";
|
||||
::setenv("XDG_DATA_HOME", dataDirectory.c_str(), 1);
|
||||
const auto ytDlp = dataDirectory / "echoion" / "yt-dlp" / "yt-dlp";
|
||||
std::filesystem::create_directories(ytDlp.parent_path());
|
||||
{
|
||||
std::ofstream output{ytDlp};
|
||||
output << "#!/bin/sh\necho 2026.01.01\n";
|
||||
output << "#!/bin/sh\necho 9999.01.01\n";
|
||||
}
|
||||
{
|
||||
std::ofstream output{ytDlp.parent_path() / ".last_update"};
|
||||
output << std::time(nullptr);
|
||||
}
|
||||
std::filesystem::permissions(ytDlp,
|
||||
std::filesystem::perms::owner_read |
|
||||
|
||||
Reference in new issue
Block a user