chore: fix directory separator on windows (#2736)
This commit is contained in:
@@ -13,6 +13,7 @@ import { RawStorageKey } from '../Storage/StorageKeys'
|
|||||||
import { HomeServerServiceInterface } from './HomeServerServiceInterface'
|
import { HomeServerServiceInterface } from './HomeServerServiceInterface'
|
||||||
import { HomeServerEnvironmentConfiguration } from './HomeServerEnvironmentConfiguration'
|
import { HomeServerEnvironmentConfiguration } from './HomeServerEnvironmentConfiguration'
|
||||||
import { HomeServerStatus } from './HomeServerStatus'
|
import { HomeServerStatus } from './HomeServerStatus'
|
||||||
|
import { Platform } from '@standardnotes/models'
|
||||||
|
|
||||||
export class HomeServerService
|
export class HomeServerService
|
||||||
extends AbstractService
|
extends AbstractService
|
||||||
@@ -22,6 +23,7 @@ export class HomeServerService
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private desktopDevice: DesktopDeviceInterface,
|
private desktopDevice: DesktopDeviceInterface,
|
||||||
|
private platform: Platform,
|
||||||
protected override internalEventBus: InternalEventBusInterface,
|
protected override internalEventBus: InternalEventBusInterface,
|
||||||
) {
|
) {
|
||||||
super(internalEventBus)
|
super(internalEventBus)
|
||||||
@@ -173,7 +175,8 @@ export class HomeServerService
|
|||||||
if (!documentsDirectory) {
|
if (!documentsDirectory) {
|
||||||
return
|
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)
|
await this.desktopDevice.setRawStorageValue(RawStorageKey.HomeServerDataLocation, location)
|
||||||
|
|||||||
@@ -1187,6 +1187,7 @@ export class Dependencies {
|
|||||||
|
|
||||||
return new HomeServerService(
|
return new HomeServerService(
|
||||||
this.get<DesktopDeviceInterface>(TYPES.DeviceInterface),
|
this.get<DesktopDeviceInterface>(TYPES.DeviceInterface),
|
||||||
|
this.options.platform,
|
||||||
this.get<InternalEventBus>(TYPES.InternalEventBus),
|
this.get<InternalEventBus>(TYPES.InternalEventBus),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user