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
734f5741
Commit
734f5741
authored
Jun 30, 2020
by
LianaHus
Committed by
ioedeveloper
Jul 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
bf40a9e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
48 deletions
+12
-48
fileManager.js
apps/remix-ide/src/app/files/fileManager.js
+12
-48
No files found.
apps/remix-ide/src/app/files/fileManager.js
View file @
734f5741
...
@@ -499,22 +499,18 @@ class FileManager extends Plugin {
...
@@ -499,22 +499,18 @@ class FileManager extends Plugin {
const
dirPaths
=
[]
const
dirPaths
=
[]
const
collectList
=
(
path
)
=>
{
const
collectList
=
(
path
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
isDirectory
(
path
))
{
this
.
readdir
(
path
).
then
((
ls
)
=>
{
this
.
readdir
(
path
).
then
((
ls
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
root
=
(
path
.
indexOf
(
'/'
)
===
-
1
)
?
path
:
path
.
substr
(
0
,
path
.
indexOf
(
'/'
))
const
root
=
(
path
.
indexOf
(
'/'
)
===
-
1
)
?
path
:
path
.
substr
(
0
,
path
.
indexOf
(
'/'
))
const
curPath
=
`
${
root
}
/
${
item
}
`
// adding 'browser' or 'localhost'
const
curPath
=
`
${
root
}
/
${
item
}
`
// adding 'browser' or 'localhost'
if
(
ls
[
item
].
isDirectory
&&
!
dirPaths
.
includes
(
curPath
))
{
if
(
ls
[
item
].
isDirectory
&&
!
dirPaths
.
includes
(
curPath
))
{
dirPaths
.
push
(
curPath
)
dirPaths
.
push
(
curPath
)
resolve
(
dirPaths
)
resolve
(
dirPaths
)
}
}
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
})
Promise
.
all
(
promises
).
then
(()
=>
{
resolve
(
dirPaths
)
})
})
})
}
else
{
Promise
.
all
(
promises
).
then
(()
=>
{
resolve
(
dirPaths
)
})
resolve
(
dirPaths
)
})
}
})
})
}
}
return
collectList
(
path
)
return
collectList
(
path
)
...
@@ -524,39 +520,7 @@ class FileManager extends Plugin {
...
@@ -524,39 +520,7 @@ class FileManager extends Plugin {
return
this
.
appManager
.
isActive
(
'remixd'
)
return
this
.
appManager
.
isActive
(
'remixd'
)
}
}
allPaths
()
{
const
dirPaths
=
[]
const
findPaths
=
(
path
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
isDirectory
(
path
))
{
if
(
!
dirPaths
.
includes
(
path
))
{
dirPaths
.
push
(
path
)
}
this
.
readdir
(
path
).
then
((
ls
)
=>
{
const
promises
=
Object
.
keys
(
ls
).
map
((
item
,
index
)
=>
{
const
root
=
(
path
.
indexOf
(
'/'
)
===
-
1
)
?
path
:
path
.
substr
(
0
,
path
.
indexOf
(
'/'
))
const
curPath
=
`
${
root
}
/
${
item
}
`
// adding 'browser' or 'localhost'
if
(
ls
[
item
].
isDirectory
)
{
return
findPaths
(
curPath
)
}
else
{
return
new
Promise
((
resolve
,
reject
)
=>
{
resolve
()
})
}
})
Promise
.
all
(
promises
).
then
(()
=>
{
resolve
(
dirPaths
)
})
})
}
else
{
resolve
(
dirPaths
)
}
})
}
const
roots
=
[]
roots
.
push
(
findPaths
(
'browser'
))
if
(
this
.
appManager
.
isActive
(
'remixd'
))
roots
.
push
(
findPaths
(
'localhost'
))
return
Promise
.
all
(
roots
)
}
saveCurrentFile
()
{
saveCurrentFile
()
{
var
currentFile
=
this
.
_deps
.
config
.
get
(
'currentFile'
)
var
currentFile
=
this
.
_deps
.
config
.
get
(
'currentFile'
)
...
...
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