2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
#include "frc/Filesystem.h"
|
|
|
|
|
|
2021-06-01 21:50:35 -07:00
|
|
|
#include <wpi/fs.h>
|
2018-11-03 04:16:44 +08:00
|
|
|
|
|
|
|
|
#include "frc/RobotBase.h"
|
|
|
|
|
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string frc::filesystem::GetLaunchDirectory() {
|
|
|
|
|
return fs::current_path().string();
|
2018-11-03 04:16:44 +08:00
|
|
|
}
|
|
|
|
|
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string frc::filesystem::GetOperatingDirectory() {
|
2023-09-15 20:05:16 -07:00
|
|
|
if constexpr (!RobotBase::IsSimulation()) {
|
2021-06-01 21:50:35 -07:00
|
|
|
return "/home/lvuser";
|
2018-11-03 04:16:44 +08:00
|
|
|
} else {
|
2021-06-01 21:50:35 -07:00
|
|
|
return frc::filesystem::GetLaunchDirectory();
|
2018-11-03 04:16:44 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-01 21:50:35 -07:00
|
|
|
std::string frc::filesystem::GetDeployDirectory() {
|
2023-09-15 20:05:16 -07:00
|
|
|
if constexpr (!RobotBase::IsSimulation()) {
|
2021-06-01 21:50:35 -07:00
|
|
|
return "/home/lvuser/deploy";
|
2020-01-19 16:34:45 -08:00
|
|
|
} else {
|
2021-06-01 21:50:35 -07:00
|
|
|
return (fs::current_path() / "src" / "main" / "deploy").string();
|
2020-01-19 16:34:45 -08:00
|
|
|
}
|
2018-11-03 04:16:44 +08:00
|
|
|
}
|