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
df91b923
Commit
df91b923
authored
Apr 16, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed logic for file/dir exists to use file provider
parent
4e3b8d1b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
fileManager.js
src/app/files/fileManager.js
+5
-1
fileProvider.js
src/app/files/fileProvider.js
+3
-2
No files found.
src/app/files/fileManager.js
View file @
df91b923
...
@@ -120,7 +120,11 @@ class FileManager extends Plugin {
...
@@ -120,7 +120,11 @@ class FileManager extends Plugin {
*/
*/
exists
(
path
)
{
exists
(
path
)
{
const
provider
=
this
.
fileProviderOf
(
path
)
const
provider
=
this
.
fileProviderOf
(
path
)
return
provider
?
true
:
false
// eslint-disable-line
return
provider
.
exists
(
path
,
(
err
,
result
)
=>
{
if
(
err
)
return
false
return
result
})
}
}
/**
/**
...
...
src/app/files/fileProvider.js
View file @
df91b923
...
@@ -66,12 +66,12 @@ class FileProvider {
...
@@ -66,12 +66,12 @@ class FileProvider {
exists
(
path
,
cb
)
{
exists
(
path
,
cb
)
{
// todo check the type (directory/file) as well #2386
// todo check the type (directory/file) as well #2386
// currently it is not possible to have a file and folder with same path
// currently it is not possible to have a file and folder with same path
cb
(
null
,
this
.
_exists
(
path
))
return
cb
(
null
,
this
.
_exists
(
path
))
}
}
_exists
(
path
)
{
_exists
(
path
)
{
var
unprefixedpath
=
this
.
removePrefix
(
path
)
var
unprefixedpath
=
this
.
removePrefix
(
path
)
return
window
.
remixFileSystem
.
existsSync
(
unprefixedpath
)
return
path
===
this
.
type
?
true
:
window
.
remixFileSystem
.
existsSync
(
unprefixedpath
)
}
}
init
(
cb
)
{
init
(
cb
)
{
...
@@ -79,6 +79,7 @@ class FileProvider {
...
@@ -79,6 +79,7 @@ class FileProvider {
}
}
get
(
path
,
cb
)
{
get
(
path
,
cb
)
{
console
.
log
(
'window.remixFileSystem: '
,
window
.
remixFileSystem
)
cb
=
cb
||
function
()
{}
cb
=
cb
||
function
()
{}
path
=
this
.
getPathFromUrl
(
path
)
||
path
// ensure we actually use the normalized path from here
path
=
this
.
getPathFromUrl
(
path
)
||
path
// ensure we actually use the normalized path from here
var
unprefixedpath
=
this
.
removePrefix
(
path
)
var
unprefixedpath
=
this
.
removePrefix
(
path
)
...
...
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