Skip to content

Commit

Permalink
fix: Wrong instance name start/end with space
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Nov 17, 2024
1 parent ae69174 commit b98efb9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xmcl-runtime/instance/InstanceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ export class InstanceService extends StatefulService<InstanceState> implements I
async loadInstance(path: string) {
requireString(path)

// Fix the wrong path if user set the name start/end with space
path = path.trim()

if (!isAbsolute(path)) {
path = this.getPathUnder(path)
}
Expand All @@ -138,6 +141,9 @@ export class InstanceService extends StatefulService<InstanceState> implements I
return false
}

// Fix the wrong path if user set the name start/end with space
option.name = option.name.trim()

const name = option.name
const expectPath = this.getPathUnder(filenamify(name))

Expand Down

0 comments on commit b98efb9

Please sign in to comment.