|
1 | 1 | import fs from "fs"; |
2 | | -import path, { join, win32 } from "path"; |
| 2 | +import path, { join, posix, win32 } from "path"; |
3 | 3 |
|
4 | 4 | import { Addon, DependencyInjectionAddonProvider } from "./addon-wrapper"; |
5 | 5 | import { TLogger } from "./logger"; |
@@ -51,7 +51,7 @@ class VirtualDrive { |
51 | 51 | } |
52 | 52 |
|
53 | 53 | convertToWindowsPath({ path }: { path: string }) { |
54 | | - return path.replaceAll("/", win32.sep); |
| 54 | + return path.replaceAll(posix.sep, win32.sep); |
55 | 55 | } |
56 | 56 |
|
57 | 57 | fixPath(path: string) { |
@@ -89,12 +89,8 @@ class VirtualDrive { |
89 | 89 | return this.addon.deleteFileSyncRoot({ path: this.fixPath(path) }); |
90 | 90 | } |
91 | 91 |
|
92 | | - connectSyncRoot() { |
93 | | - if (this.callbacks === undefined) { |
94 | | - throw new Error("Callbacks are not defined"); |
95 | | - } |
96 | | - |
97 | | - const connectionKey = this.addon.connectSyncRoot({ callbacks: this.callbacks }); |
| 92 | + connectSyncRoot({ callbacks }: { callbacks: Callbacks }) { |
| 93 | + const connectionKey = this.addon.connectSyncRoot({ callbacks }); |
98 | 94 |
|
99 | 95 | this.logger.debug({ msg: "connectSyncRoot", connectionKey }); |
100 | 96 | return connectionKey; |
@@ -180,15 +176,12 @@ class VirtualDrive { |
180 | 176 | async registerSyncRoot({ |
181 | 177 | providerName, |
182 | 178 | providerVersion, |
183 | | - callbacks, |
184 | 179 | logoPath, |
185 | 180 | }: { |
186 | 181 | providerName: string; |
187 | 182 | providerVersion: string; |
188 | | - callbacks: Callbacks; |
189 | 183 | logoPath: string; |
190 | 184 | }): Promise<any> { |
191 | | - this.callbacks = callbacks; |
192 | 185 | this.logger.debug({ msg: "Registering sync root", syncRootPath: this.syncRootPath }); |
193 | 186 | return this.addon.registerSyncRoot({ |
194 | 187 | providerName, |
|
0 commit comments