diff options
author | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-10-19 21:53:57 +0800 |
---|---|---|
committer | Ryan Cao <70191398+ryanccn@users.noreply.github.com> | 2022-11-05 22:17:59 +0800 |
commit | 7b1e68bfa8cf9d46e0c810cfa0f077427cfc707a (patch) | |
tree | 87782c5e9f960f67dcc9dfbe499b5f1fad53a499 /launcher/FileSystem.cpp | |
parent | 2999afe7815d0c2a557e95c7518e192650fdc652 (diff) | |
download | PrismLauncher-7b1e68bfa8cf9d46e0c810cfa0f077427cfc707a.tar.gz PrismLauncher-7b1e68bfa8cf9d46e0c810cfa0f077427cfc707a.tar.bz2 PrismLauncher-7b1e68bfa8cf9d46e0c810cfa0f077427cfc707a.zip |
initial support for add to PATH action
Signed-off-by: Ryan Cao <70191398+ryanccn@users.noreply.github.com>
Diffstat (limited to 'launcher/FileSystem.cpp')
-rw-r--r-- | launcher/FileSystem.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp index 4026d6c1..13bb95d9 100644 --- a/launcher/FileSystem.cpp +++ b/launcher/FileSystem.cpp @@ -163,6 +163,19 @@ bool ensureFolderPathExists(QString foldernamepath) return success; } +bool symlink(const QString& source, const QString& target) +{ + std::error_code err; + + fs::create_symlink(toStdString(source), toStdString(target)); + + if (err) { + qWarning() << "Failed to symlink files:" << QString::fromStdString(err.message()); + } + + return err.value() == 0; +} + bool copy::operator()(const QString& offset) { using copy_opts = fs::copy_options; |