int opt_ = 0;
};
+std::vector<std::string> ValidateAndModifyGadgetPaths(
+ const std::vector<std::string> gadget_paths) {
+ std::vector<std::string> paths;
+ for (const auto& path : gadget_paths) {
+ if (access(path.c_str(), F_OK) == 0)
+ paths.push_back(path);
+ else
+ paths.push_back(fs::path(path).parent_path().string());
+ }
+
+ return paths;
+}
+
} // namespace
void Util::SetEnvironments(const AppInfo* app_info) {
int Util::MountGadgetDirectories(const tizen_base::Bundle& b) {
auto gadget_paths = b.GetStringArray(kAulMountGadgetPaths);
if (!gadget_paths.empty()) {
+ gadget_paths = ValidateAndModifyGadgetPaths(gadget_paths);
auto root_path = b.GetString(kAulRootPath);
return MountDirectories(gadget_paths, root_path + "/bin");
}