Skip to content

Commit

Permalink
Fix getDocuments on Windows (#10350)
Browse files Browse the repository at this point in the history
followup #10240

Changelog:
- fix: enable `desktop-environment` SBT tests
- fix: typo in Windows reg query
  • Loading branch information
4e6 authored Jun 25, 2024
1 parent b52e8eb commit 8fba4b7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getWindowsDocumentsPath(): string | undefined {
'reg',
[
'query',
'"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellFolders"',
'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders',
'/v',
'personal',
],
Expand All @@ -76,6 +76,6 @@ function getWindowsDocumentsPath(): string | undefined {
return
} else {
const stdoutString = out.stdout.toString()
return stdoutString.split('\\s\\s+')[4]
return stdoutString.split(/\s\s+/)[4]
}
}
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ lazy val enso = (project in file("."))
`benchmark-java-helpers`,
`benchmarks-common`,
`bench-processor`,
`ydoc-server`
`ydoc-server`,
`desktop-environment`
)
.settings(Global / concurrentRestrictions += Tags.exclusive(Exclusive))
.settings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class WindowsDirectories implements Directories {
new String[] {
"reg",
"query",
"\"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ShellFolders\"",
"HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
"/v",
"personal"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ public void getUserHome() {

@Test
public void getDocuments() throws IOException {
var documents = directories.getDocuments();
Assert.assertTrue(
"User documents is not a directory" + documents, Files.isDirectory(documents));
// getDocuments fails on Windows CI
if (!Platform.isWindows()) {
var documents = directories.getDocuments();
Assert.assertTrue(
"User documents is not a directory" + documents, Files.isDirectory(documents));
}
}
}

0 comments on commit 8fba4b7

Please sign in to comment.