camoufox-js 0.4.1 → 0.6.0
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/dist/__main__.js +0 -0
- package/dist/pkgman.d.ts +1 -1
- package/dist/pkgman.js +6 -2
- package/package.json +1 -1
package/dist/__main__.js
CHANGED
|
File without changes
|
package/dist/pkgman.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare class CamoufoxFetcher extends GitHubDownloader {
|
|
|
40
40
|
static getPlatformArch(): string;
|
|
41
41
|
fetchLatest(): Promise<void>;
|
|
42
42
|
static downloadFile(url: string): Promise<Buffer>;
|
|
43
|
-
extractZip(zipFile: Buffer): Promise<void>;
|
|
43
|
+
extractZip(zipFile: string | Buffer): Promise<void>;
|
|
44
44
|
static cleanup(): boolean;
|
|
45
45
|
setVersion(): void;
|
|
46
46
|
install(): Promise<void>;
|
package/dist/pkgman.js
CHANGED
|
@@ -180,8 +180,12 @@ export class CamoufoxFetcher extends GitHubDownloader {
|
|
|
180
180
|
await CamoufoxFetcher.cleanup();
|
|
181
181
|
try {
|
|
182
182
|
fs.mkdirSync(INSTALL_DIR, { recursive: true });
|
|
183
|
-
const
|
|
184
|
-
|
|
183
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'camoufox-'));
|
|
184
|
+
const tempFilePath = path.join(tempDir, 'camoufox.zip');
|
|
185
|
+
const tempFileStream = fs.createWriteStream(tempFilePath);
|
|
186
|
+
await webdl(this.url, 'Downloading Camoufox...', true, tempFileStream);
|
|
187
|
+
await new Promise(r => tempFileStream.close(r));
|
|
188
|
+
await this.extractZip(tempFilePath);
|
|
185
189
|
this.setVersion();
|
|
186
190
|
if (OS_NAME !== 'win') {
|
|
187
191
|
execSync(`chmod -R 755 ${INSTALL_DIR}`);
|