Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix directory separator on windows #2736

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/services/src/Domain/HomeServer/HomeServerService.ts
Expand Up @@ -13,6 +13,7 @@ import { RawStorageKey } from '../Storage/StorageKeys'
import { HomeServerServiceInterface } from './HomeServerServiceInterface'
import { HomeServerEnvironmentConfiguration } from './HomeServerEnvironmentConfiguration'
import { HomeServerStatus } from './HomeServerStatus'
import { Platform } from '@standardnotes/models'

export class HomeServerService
extends AbstractService
Expand All @@ -22,6 +23,7 @@ export class HomeServerService

constructor(
private desktopDevice: DesktopDeviceInterface,
private platform: Platform,
protected override internalEventBus: InternalEventBusInterface,
) {
super(internalEventBus)
Expand Down Expand Up @@ -173,7 +175,8 @@ export class HomeServerService
if (!documentsDirectory) {
return
}
location = `${documentsDirectory}/${this.HOME_SERVER_DATA_DIRECTORY_NAME}`
const separator = this.platform === Platform.WindowsDesktop ? '\\' : '/'
location = `${documentsDirectory}${separator}${this.HOME_SERVER_DATA_DIRECTORY_NAME}`
}

await this.desktopDevice.setRawStorageValue(RawStorageKey.HomeServerDataLocation, location)
Expand Down
1 change: 1 addition & 0 deletions packages/snjs/lib/Application/Dependencies/Dependencies.ts
Expand Up @@ -1187,6 +1187,7 @@ export class Dependencies {

return new HomeServerService(
this.get<DesktopDeviceInterface>(TYPES.DeviceInterface),
this.options.platform,
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})
Expand Down