Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
4cc3802d
Commit
4cc3802d
authored
May 07, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Remixd folder delete bug and changed rmdir, unlink to remove api
parent
fcec4fef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
30 deletions
+22
-30
file-explorer.js
src/app/files/file-explorer.js
+16
-6
fileManager.js
src/app/files/fileManager.js
+5
-22
remixDProvider.js
src/app/files/remixDProvider.js
+1
-2
No files found.
src/app/files/file-explorer.js
View file @
4cc3802d
...
...
@@ -236,12 +236,14 @@ function fileExplorer (localRegistry, files, menuItems) {
modalDialogCustom
.
confirm
(
`Confirm to delete folder`
,
`Are you sure you want to delete
${
currentFoldername
}
folder?`
,
async
()
=>
{
const
fileManager
=
self
.
_deps
.
fileManager
const
removeFolder
=
await
fileManager
.
r
mdir
(
key
)
const
removeFolder
=
await
fileManager
.
r
emove
(
key
)
if
(
!
removeFolder
)
{
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
}
else
{
self
.
updatePath
(
'browser'
)
const
{
type
}
=
fileManager
.
currentFileProvider
()
self
.
updatePath
(
type
)
}
},
()
=>
{})
}
...
...
@@ -278,9 +280,17 @@ function fileExplorer (localRegistry, files, menuItems) {
modalDialogCustom
.
confirm
(
`Delete file`
,
`Are you sure you want to delete
${
currentFilename
}
file?`
,
()
=>
{
files
.
remove
(
key
)
self
.
updatePath
(
'browser'
)
async
()
=>
{
const
fileManager
=
self
.
_deps
.
fileManager
const
removeFile
=
await
fileManager
.
remove
(
key
)
if
(
!
removeFile
)
{
tooltip
(
`failed to remove file
${
key
}
.`
)
}
else
{
const
{
type
}
=
fileManager
.
currentFileProvider
()
self
.
updatePath
(
type
)
}
},
()
=>
{}
)
...
...
src/app/files/fileManager.js
View file @
4cc3802d
...
...
@@ -23,7 +23,7 @@ const profile = {
icon
:
'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4='
,
permission
:
true
,
version
:
packageJson
.
version
,
methods
:
[
'file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'
unlink'
,
'rename'
,
'readdir'
,
'rmdir
'
],
methods
:
[
'file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'
rename'
,
'readdir'
,
'remove
'
],
kind
:
'file-system'
}
const
errorMsg
=
{
...
...
@@ -191,20 +191,6 @@ class FileManager extends Plugin {
}
/**
* Removes a file
* @param {string} path path of the file to remove
* @note will not work on a directory, use `rmdir` instead
* @returns {void}
*/
async
unlink
(
path
)
{
await
this
.
_handleExists
(
path
,
`Cannot remove file
${
path
}
`
)
await
this
.
_handleIsDir
(
path
,
`Cannot remove file
${
path
}
`
)
const
provider
=
this
.
fileProviderOf
(
path
)
provider
.
removeFile
(
path
)
}
/**
* Change the path of a file/directory
* @param {string} oldPath current path of the file/directory
* @param {string} newPath new path of the file/directory
...
...
@@ -251,15 +237,12 @@ class FileManager extends Plugin {
}
/**
* Removes a directory recursively
* @param {string} path path of the directory to remove
* @note will not work on a file, use `unlink` instead
* Removes a file or directory recursively
* @param {string} path path of the directory/file to remove
* @returns {void}
*/
async
rmdir
(
path
)
{
await
this
.
_handleExists
(
path
,
`Cannot remove directory
${
path
}
`
)
await
this
.
_handleIsDir
(
path
,
`Cannot remove directory
${
path
}
`
)
async
remove
(
path
)
{
await
this
.
_handleExists
(
path
,
`Cannot remove file or directory
${
path
}
`
)
const
provider
=
this
.
fileProviderOf
(
path
)
return
await
provider
.
remove
(
path
)
...
...
src/app/files/remixDProvider.js
View file @
4cc3802d
...
...
@@ -129,8 +129,7 @@ module.exports = class RemixDProvider {
})
})
await
this
.
_remixd
.
receiveResponse
(
callId
)
return
true
return
await
this
.
_remixd
.
receiveResponse
(
callId
)
}
rename
(
oldPath
,
newPath
,
isFolder
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment