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
4e3b8d1b
Commit
4e3b8d1b
authored
Apr 15, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting error
parent
a545296b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
fileManager.js
src/app/files/fileManager.js
+11
-11
No files found.
src/app/files/fileManager.js
View file @
4e3b8d1b
...
...
@@ -108,7 +108,7 @@ class FileManager extends Plugin {
/** The current opened file */
file
()
{
const
file
=
this
.
currentFile
()
if
(
!
file
)
this
.
_handleError
({
code
:
'ENOENT'
,
message
:
'No file selected'
})
return
file
}
...
...
@@ -118,9 +118,9 @@ class FileManager extends Plugin {
* @param {string} path path of the directory or file
* @returns {boolean} true if the path exists
*/
exists
(
path
)
{
exists
(
path
)
{
const
provider
=
this
.
fileProviderOf
(
path
)
return
provider
?
true
:
false
return
provider
?
true
:
false
// eslint-disable-line
}
/**
...
...
@@ -142,10 +142,10 @@ class FileManager extends Plugin {
open
(
path
)
{
this
.
_handleExists
(
path
,
`Cannot open file
${
path
}
`
)
this
.
_handleIsFile
(
path
,
`Cannot open file
${
path
}
`
)
this
.
switchFile
(
path
)
return
this
.
switchFile
(
path
)
}
/**
/**
* Set the content of a specific file
* @param {string} path path of the file
* @param {string} data content to write on the file
...
...
@@ -167,7 +167,7 @@ class FileManager extends Plugin {
return
this
.
getFile
(
path
)
}
/**
/**
* Upsert a file with the content of the source file
* @param {string} src path of the source file
* @param {string} dest path of the destrination file
...
...
@@ -187,12 +187,12 @@ class FileManager extends Plugin {
* @note will not work on a directory, use `rmdir` instead
* @returns {void}
*/
unlink
(
path
)
{
unlink
(
path
)
{
this
.
_handleExists
(
path
,
`Cannot remove file
${
path
}
`
)
this
.
_handleIsDir
(
path
,
`Cannot remove file
${
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
...
...
@@ -217,7 +217,7 @@ class FileManager extends Plugin {
// To implement
}
/**
/**
* Get the list of files in the directory
* @param {string} path path of the directory
* @returns {string[]} list of the file/directory name in this directory
...
...
@@ -242,7 +242,7 @@ class FileManager extends Plugin {
* @note will not work on a file, use `unlink` instead
* @returns {void}
*/
rmdir
(
path
)
{
rmdir
(
path
)
{
this
.
_handleExists
(
path
,
`Cannot remove directory
${
path
}
`
)
this
.
_handleIsDir
(
path
,
`Cannot remove directory
${
path
}
`
)
// To implement
...
...
@@ -337,7 +337,7 @@ class FileManager extends Plugin {
getFile
(
path
)
{
const
provider
=
this
.
fileProviderOf
(
path
)
if
(
!
provider
)
this
.
_handleError
({
code
:
'ENOENT'
,
message
:
`
${
path
}
not available`
})
// TODO: change provider to Promise
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
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