@milaboratories/pl-drivers 1.3.5 → 1.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@milaboratories/pl-drivers",
3
- "version": "1.3.5",
3
+ "version": "1.3.7",
4
4
  "description": "Drivers and a low-level clients for log streaming, downloading and uploading files from and to pl",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -27,16 +27,16 @@
27
27
  "undici": "^6.20.1",
28
28
  "zod": "^3.23.8",
29
29
  "@milaboratories/ts-helpers": "^1.1.0",
30
- "@milaboratories/computable": "^2.2.0",
31
30
  "@milaboratories/pl-tree": "^1.4.6",
32
- "@milaboratories/pl-model-common": "^1.5.0",
33
- "@milaboratories/pl-client": "^2.5.5"
31
+ "@milaboratories/pl-model-common": "^1.5.2",
32
+ "@milaboratories/pl-client": "^2.5.5",
33
+ "@milaboratories/computable": "^2.2.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "typescript": "~5.5.4",
37
37
  "vite": "^5.4.10",
38
- "@types/node": "~20.16.10",
39
- "@types/jest": "^29.5.13",
38
+ "@types/node": "~20.16.15",
39
+ "@types/jest": "^29.5.14",
40
40
  "@types/tar-fs": "^2.0.4",
41
41
  "jest": "^29.7.0",
42
42
  "@jest/globals": "^29.7.0",
@@ -22,20 +22,28 @@ export async function DefaultVirtualLocalStorages(): Promise<VirtualLocalStorage
22
22
  // code below inspired by
23
23
  // https://stackoverflow.com/a/52411712/769192
24
24
 
25
- const wmic = await util.promisify(exec)('wmic logicaldisk get name');
26
- // parsing wmic output
27
- const drives = wmic.stdout
28
- .split('\r\n')
29
- .filter((line) => line.includes(':'))
30
- .map((line) => line.trim().replaceAll(':', ''));
25
+ try {
26
+ const wmic = await util.promisify(exec)('wmic logicaldisk get name');
27
+ // parsing wmic output
28
+ const drives = wmic.stdout
29
+ .split('\r\n')
30
+ .filter((line) => line.includes(':'))
31
+ .map((line) => line.trim().replaceAll(':', ''));
31
32
 
32
- return drives.map((drive) => {
33
- const isHomeDrive = drive == homeDrive;
34
- return {
35
- name: `local_disk_${drive}`,
36
- root: `${drive}:\\`,
37
- initialPath: isHomeDrive ? home : `${drive}:\\`
38
- }
39
- });
33
+ return drives.map((drive) => {
34
+ const isHomeDrive = drive == homeDrive;
35
+ return {
36
+ name: `local_disk_${drive}`,
37
+ root: `${drive}:\\`,
38
+ initialPath: isHomeDrive ? home : `${drive}:\\`
39
+ }
40
+ });
41
+ } catch (e: any) {
42
+ return [{
43
+ name: `local_disk_${homeDrive}`,
44
+ root: `${homeDrive}:\\`,
45
+ initialPath: home
46
+ }]
47
+ }
40
48
  }
41
49
  }