camoufox-js 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/pkgman.js +12 -1
  2. package/package.json +1 -1
package/dist/pkgman.js CHANGED
@@ -22,7 +22,7 @@ if (!(process.platform in OS_MAP)) {
22
22
  throw new UnsupportedOS(`OS ${process.platform} is not supported`);
23
23
  }
24
24
  export const OS_NAME = OS_MAP[process.platform];
25
- export const INSTALL_DIR = path.join(os.homedir(), '.cache', 'camoufox');
25
+ export const INSTALL_DIR = userCacheDir('camoufox');
26
26
  export const LOCAL_DATA = path.join(import.meta.dirname, 'data-files');
27
27
  export const OS_ARCH_MATRIX = {
28
28
  'win': ['x86_64', 'i686'],
@@ -219,6 +219,17 @@ export class CamoufoxFetcher extends GitHubDownloader {
219
219
  return this._version_obj.fullString;
220
220
  }
221
221
  }
222
+ function userCacheDir(appName) {
223
+ if (OS_NAME === 'win') {
224
+ return path.join(os.homedir(), 'AppData', 'Local', appName, appName, 'Cache');
225
+ }
226
+ else if (OS_NAME === 'mac') {
227
+ return path.join(os.homedir(), 'Library', 'Caches', appName);
228
+ }
229
+ else {
230
+ return path.join(os.homedir(), '.cache', appName);
231
+ }
232
+ }
222
233
  export function installedVerStr() {
223
234
  return Version.fromPath().fullString;
224
235
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camoufox-js",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {