diff --git a/xmcl-runtime/instance/InstanceService.ts b/xmcl-runtime/instance/InstanceService.ts index c2f283986..7c597e980 100644 --- a/xmcl-runtime/instance/InstanceService.ts +++ b/xmcl-runtime/instance/InstanceService.ts @@ -120,6 +120,9 @@ export class InstanceService extends StatefulService 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) } @@ -138,6 +141,9 @@ export class InstanceService extends StatefulService 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))