一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
35 行
1.1 KiB
TypeScript
35 行
1.1 KiB
TypeScript
import { ImportExportResult } from './types';
|
|
|
|
import InteropService_Importer_Base from './InteropService_Importer_Base';
|
|
import InteropService_Importer_Raw from './InteropService_Importer_Raw';
|
|
import { filename } from '../../path-utils';
|
|
import shim from '../../shim';
|
|
|
|
export default class InteropService_Importer_Jex extends InteropService_Importer_Base {
|
|
public async exec(result: ImportExportResult) {
|
|
const tempDir = await this.temporaryDirectory_(true);
|
|
|
|
try {
|
|
await shim.fsDriver().tarExtract({
|
|
strict: true,
|
|
portable: true,
|
|
file: this.sourcePath_,
|
|
cwd: tempDir,
|
|
});
|
|
} catch (error) {
|
|
error.message = `Could not decompress "${this.sourcePath_}". The file may be corrupted. Error was: ${error.message}`;
|
|
throw error;
|
|
}
|
|
|
|
if (!('defaultFolderTitle' in this.options_)) this.options_.defaultFolderTitle = filename(this.sourcePath_);
|
|
|
|
const importer = new InteropService_Importer_Raw();
|
|
await importer.init(tempDir, this.options_);
|
|
result = await importer.exec(result);
|
|
|
|
await shim.fsDriver().remove(tempDir);
|
|
|
|
return result;
|
|
}
|
|
}
|