Ensure database sources are zipped on re-import
This commit is contained in:
Родитель
fe957db17a
Коммит
31cfaebb59
|
@ -666,7 +666,9 @@ function isFile(databaseUrl: string) {
|
|||
*
|
||||
* @param databasePath The full path to the unzipped database
|
||||
*/
|
||||
async function ensureZippedSourceLocation(databasePath: string): Promise<void> {
|
||||
export async function ensureZippedSourceLocation(
|
||||
databasePath: string,
|
||||
): Promise<void> {
|
||||
const srcFolderPath = join(databasePath, "src");
|
||||
const srcZipPath = `${srcFolderPath}.zip`;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ import { DatabaseResolver } from "./database-resolver";
|
|||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
import type { LanguageContextStore } from "../../language-context-store";
|
||||
import type { DatabaseOrigin } from "./database-origin";
|
||||
import { ensureZippedSourceLocation } from "../database-fetcher";
|
||||
|
||||
/**
|
||||
* The name of the key in the workspaceState dictionary in which we
|
||||
|
@ -260,6 +261,7 @@ export class DatabaseManager extends DisposableObject {
|
|||
|
||||
await this.removeDatabaseItem(dbItem);
|
||||
await copy(dbItem.origin.path, databaseUri.fsPath);
|
||||
await ensureZippedSourceLocation(databaseUri.fsPath);
|
||||
const newDbItem = new DatabaseItemImpl(databaseUri, dbItem.contents, {
|
||||
dateAdded: Date.now(),
|
||||
language: dbItem.language,
|
||||
|
|
Загрузка…
Ссылка в новой задаче