mirror of
https://github.com/modrinth/code.git
synced 2026-08-25 09:04:55 +00:00
fix: export modal path handling (#6949)
* fix: export modal path handling * fix: prepr * fix: NEVER_EXPORTABLE_PATH_SUFFIXES list
This commit is contained in:
@@ -282,12 +282,13 @@ export async function update_repair_modrinth(instanceId: string): Promise<Instal
|
||||
}
|
||||
|
||||
// Export an instance to .mrpack
|
||||
// included_overrides is an array of paths to override folders to include (ie: 'mods', 'resource_packs')
|
||||
// included_overrides and excluded_overrides are inherited path rules for files in the export.
|
||||
// Version id is optional (ie: 1.1.5)
|
||||
export async function export_instance_mrpack(
|
||||
instanceId: string,
|
||||
exportLocation: string,
|
||||
includedOverrides: string[],
|
||||
excludedOverrides: string[],
|
||||
versionId?: string,
|
||||
description?: string,
|
||||
name?: string,
|
||||
@@ -296,22 +297,33 @@ export async function export_instance_mrpack(
|
||||
instanceId,
|
||||
exportLocation,
|
||||
includedOverrides,
|
||||
excludedOverrides,
|
||||
versionId,
|
||||
description,
|
||||
name,
|
||||
})
|
||||
}
|
||||
|
||||
// Given a folder path, populate an array of all the subfolders
|
||||
// Intended to be used for finding potential override folders
|
||||
// profile
|
||||
// -- mods
|
||||
// -- resourcepacks
|
||||
// -- file1
|
||||
// => [mods, resourcepacks]
|
||||
// allows selection for 'included_overrides' in export_instance_mrpack
|
||||
export async function get_pack_export_candidates(instanceId: string): Promise<string[]> {
|
||||
return await invoke('plugin:instance|instance_get_pack_export_candidates', { instanceId })
|
||||
export type PackExportCandidate = {
|
||||
path: string
|
||||
type: 'directory' | 'file'
|
||||
size?: number
|
||||
modified?: number
|
||||
count?: number
|
||||
disabled: boolean
|
||||
defaultSelected: boolean
|
||||
}
|
||||
|
||||
// Given a folder path, populate an array of exportable direct children.
|
||||
// Allows selection for 'included_overrides' in export_instance_mrpack.
|
||||
export async function get_pack_export_candidates(
|
||||
instanceId: string,
|
||||
parent?: string,
|
||||
): Promise<PackExportCandidate[]> {
|
||||
return await invoke('plugin:instance|instance_get_pack_export_candidates', {
|
||||
instanceId,
|
||||
parent: parent ?? null,
|
||||
})
|
||||
}
|
||||
|
||||
// Run Minecraft using an instance
|
||||
|
||||
Reference in New Issue
Block a user