Skip to content

Commit

Permalink
fix: directory logic
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 committed Jun 24, 2024
1 parent ad5f2c9 commit 40f23bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,16 @@ export function getProjectRoot(subtreePath: string): string | null {
/** Get the directory that stores Enso projects. */
export function getProjectsDirectory(): string {
const documentsPath = desktopEnvironment.DOCUMENTS
const userHomeProjects = pathModule.join(os.homedir(), 'enso', 'projects')
if (documentsPath === undefined) {
return pathModule.join(os.homedir(), 'enso', 'projects')
return userHomeProjects
} else {
return pathModule.join(documentsPath, 'enso-projects')
const documentsProjects = pathModule.join(documentsPath, 'enso-projects')
if (fs.lstatSync(documentsProjects).isDirectory()) {
return documentsProjects
} else {
return userHomeProjects
}
}
}

Expand Down
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

0 comments on commit 40f23bd

Please sign in to comment.