Skip to content

Commit edcd4c4

Browse files
authored
[v1.8.4] Merge pull request #398 from bridge-core/dev
2 parents ce523b8 + 8fba2ff commit edcd4c4

File tree

4 files changed

+55
-52
lines changed

4 files changed

+55
-52
lines changed

app/renderer/src/UI/Windows/Project/Chooser/load.ts

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -42,59 +42,64 @@ export async function loadProjects() {
4242
}
4343

4444
async function loadManifest(projectPath: string) {
45-
const manifestPath = join(projectPath, 'manifest.json')
46-
let manifest = await readJSON(manifestPath).catch(() => ({
47-
header: {},
48-
metadata: {},
49-
}))
50-
let {
51-
header: { version, name, description },
52-
metadata: { author } = {
53-
author: 'Unknown',
54-
},
55-
} = manifest
45+
let langDescription: string
46+
try {
47+
const langFile = (
48+
await fs.readFile(join(projectPath, 'texts/en_US.lang'))
49+
).toString('utf-8')
50+
const lines = langFile.split('\n')
5651

57-
if (description === 'pack.description') {
58-
try {
59-
const langFile = (
60-
await fs.readFile(join(projectPath, 'texts/en_US.lang'))
61-
).toString('utf-8')
62-
const lines = langFile.split('\n')
52+
for (let line of lines) {
53+
const [key, value] = line.split('=')
54+
if (key.trim() === 'pack.description')
55+
langDescription = value.trim()
56+
}
57+
} catch {}
58+
try {
59+
const manifestPath = join(projectPath, 'manifest.json')
60+
let manifest = await readJSON(manifestPath)
61+
let {
62+
header: { version, name, description },
63+
metadata: { author } = {
64+
author: 'Unknown',
65+
},
66+
} = manifest
6367

64-
for (let line of lines) {
65-
const [key, value] = line.split('=')
66-
if (key.trim() === 'pack.description')
67-
description = value.trim()
68-
}
69-
} catch {}
70-
}
68+
if (description === 'pack.description') description = langDescription
7169

72-
const appVersion = APP_VERSION.replace('v', '')
73-
const generatedWithBridge: string[] | undefined =
74-
manifest?.metadata?.generated_with?.bridge
75-
if (generatedWithBridge) {
76-
if (!generatedWithBridge.includes(appVersion))
77-
generatedWithBridge.push(appVersion)
78-
} else {
79-
manifest = {
80-
...(manifest ?? {}),
81-
metadata: {
82-
...(manifest?.metadata ?? {}),
83-
generated_with: {
84-
...(manifest?.metadata?.generated_with ?? {}),
85-
bridge: [appVersion],
70+
const appVersion = APP_VERSION.replace('v', '')
71+
const generatedWithBridge: string[] | undefined =
72+
manifest?.metadata?.generated_with?.bridge
73+
if (generatedWithBridge) {
74+
if (!generatedWithBridge.includes(appVersion))
75+
generatedWithBridge.push(appVersion)
76+
} else {
77+
manifest = {
78+
...(manifest ?? {}),
79+
metadata: {
80+
...(manifest?.metadata ?? {}),
81+
generated_with: {
82+
...(manifest?.metadata?.generated_with ?? {}),
83+
bridge: generatedWithBridge ?? [appVersion],
84+
},
8685
},
87-
},
86+
}
8887
}
89-
}
9088

91-
await writeJSON(manifestPath, manifest, true)
92-
93-
return {
94-
version,
95-
name,
96-
author,
97-
description,
89+
await writeJSON(manifestPath, manifest, true)
90+
return {
91+
version,
92+
name,
93+
author,
94+
description,
95+
}
96+
} catch {
97+
return {
98+
version: undefined,
99+
name: undefined,
100+
author: undefined,
101+
description: undefined,
102+
}
98103
}
99104
}
100105

app/renderer/src/UI/Windows/Project/Create/BP/Main.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040

4141
<p class="mt-10">
4242
The target Minecraft version should be set to what version you
43-
are developing for. Currently
44-
<strong>{{ MC_STABLE_VERSION }}</strong> is the stable release.
45-
and <strong>{{ MC_BETA_VERSION }}</strong> is the beta release.
43+
are developing for.
4644
</p>
4745
<v-select
4846
background-color="background"

app/shared/app_version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/**
22
* Current bridge. app version
33
*/
4-
export default 'v1.8.3'
4+
export default 'v1.8.4'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bridge",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"private": true,
55
"author": "solvedDev <[email protected]>",
66
"description": "A powerful add-on editor",

0 commit comments

Comments
 (0)