Skip to content

Commit 114ba13

Browse files
committed
Fix #644 pack.mcmeta saving
1 parent 94a8210 commit 114ba13

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/components/generator/FileCreation.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ export function FileCreation({ docAndNode, gen, method }: Props) {
4242
}
4343
const id = Identifier.parse(fileId.includes(':') || project.namespace === undefined ? fileId : `${project.namespace}:${fileId}`)
4444
const pack = gen.tags?.includes('assets') ? 'assets' : 'data'
45-
const uri = `${getProjectRoot(project)}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}.json`
45+
const projectRoot = getProjectRoot(project)
46+
const uri = gen.id === 'pack_mcmeta'
47+
? `${projectRoot}pack.mcmeta`
48+
: `${projectRoot}${pack}/${id.namespace}/${genPath(gen, version)}/${id.path}.json`
4649
Analytics.saveProjectFile(method)
4750
const text = docAndNode.doc.getText()
4851
client.fs.writeFile(uri, text).then(() => {

0 commit comments

Comments
 (0)