mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-20 12:42:54 +00:00
misc: configurator: remove config files when choosing a working folder
Instead of deleting all files, just remove xml and launch scripts. Tracked-On: #7495 Signed-off-by: Calvin Zhang <calvinzhang.cool@gmail.com>
This commit is contained in:
parent
5c72036a67
commit
a8a9b2f40a
@ -68,17 +68,25 @@ export default {
|
||||
.then((files) => {
|
||||
console.log("Directory exists.", files)
|
||||
if (files.length > 0) {
|
||||
confirm(`Warning: all existing files in the following working folder will be deleted: \n${folderPath}`)
|
||||
confirm(`Warning: delete previous config files in the following working folder: \n${folderPath}?`)
|
||||
.then((r) => {
|
||||
if (r) {
|
||||
configurator.removeDir(folderPath)
|
||||
.then(()=> {
|
||||
configurator.creatDir(folderPath)
|
||||
this.nextPage(folderPath)
|
||||
})
|
||||
.catch((err) => alert(`${err}`))
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
console.log("file: ", files[i].path)
|
||||
let arr = files[i].path.split('.')
|
||||
let suffix = arr[arr.length - 1]
|
||||
console.log("suffix:", suffix)
|
||||
if (suffix == 'sh' || suffix == 'xml') {
|
||||
console.log("removing: ", files[i].path)
|
||||
configurator.removeFile(files[i].path)
|
||||
.catch((err) => alert(`${err}`))
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
this.nextPage(folderPath)
|
||||
})
|
||||
} else {
|
||||
this.nextPage(folderPath)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user