misc: configurator: Fix user-input working directory not working

User-input working directory will not work if there's no path split at
the end. This patch checks and adds if no path split at the end of
working directory path.

Tracked-On: #7484
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
Yifan Liu 2022-05-17 08:45:05 +08:00 committed by acrnsi-robot
parent c1528cd479
commit 0adfe7a439

View File

@ -59,6 +59,9 @@ export default {
if (folderPath[0] === '~') {
folderPath = window.systemInfo.homeDir + window.systemInfo.pathSplit + folderPath.substring(1)
}
if (folderPath.charAt(folderPath.length - 1) !== window.systemInfo.pathSplit) {
folderPath = folderPath + window.systemInfo.pathSplit;
}
this.WorkingFolder = folderPath;
configurator.readDir(folderPath, false)