Skip to content

Commit

Permalink
fix: normalize path before calling ShowItemInFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpdev committed Mar 21, 2024
1 parent 7609156 commit 9f07955
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion shell/common/api/electron_api_shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ v8::Local<v8::Promise> OpenExternal(const GURL& url, gin::Arguments* args) {
return handle;
}

void ShowItemInFolder(const base::FilePath& full_path) {
base::FilePath normalized_full_path = full_path.NormalizePathSeparators();

platform_util::ShowItemInFolder(normalized_full_path);
}

v8::Local<v8::Promise> OpenPath(v8::Isolate* isolate,
const base::FilePath& full_path) {
gin_helper::Promise<const std::string&> promise(isolate);
Expand Down Expand Up @@ -172,7 +178,7 @@ void Initialize(v8::Local<v8::Object> exports,
v8::Local<v8::Context> context,
void* priv) {
gin_helper::Dictionary dict(context->GetIsolate(), exports);
dict.SetMethod("showItemInFolder", &platform_util::ShowItemInFolder);
dict.SetMethod("showItemInFolder", &ShowItemInFolder);
dict.SetMethod("openPath", &OpenPath);
dict.SetMethod("openExternal", &OpenExternal);
dict.SetMethod("trashItem", &TrashItem);
Expand Down

0 comments on commit 9f07955

Please sign in to comment.