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
420392a3
Unverified
Commit
420392a3
authored
Oct 04, 2019
by
yann300
Committed by
GitHub
Oct 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #87 from ethereum/fix_adding_removing_folder
Fix set folder / files
parents
f781cffd
3a255fb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
sharedFolder.js
src/services/sharedFolder.js
+11
-4
No files found.
src/services/sharedFolder.js
View file @
420392a3
...
...
@@ -69,6 +69,7 @@ module.exports = {
set
:
function
(
args
,
cb
)
{
if
(
this
.
readOnly
)
return
cb
(
'Cannot write file: read-only mode selected'
)
const
isFolder
=
args
.
path
.
endsWith
(
'/'
)
var
path
=
utils
.
absolutePath
(
args
.
path
,
this
.
sharedFolder
)
if
(
fs
.
existsSync
(
path
)
&&
!
isRealPath
(
path
,
cb
))
return
if
(
args
.
content
===
'undefined'
)
{
// no !!!!!
...
...
@@ -76,10 +77,16 @@ module.exports = {
return
}
this
.
trackDownStreamUpdate
[
path
]
=
path
fs
.
writeFile
(
path
,
args
.
content
,
'utf8'
,
(
error
,
data
)
=>
{
if
(
error
)
console
.
log
(
error
)
cb
(
error
,
data
)
})
if
(
isFolder
)
{
fs
.
mkdirp
(
path
).
then
(
_
=>
cb
()).
catch
(
e
=>
cb
(
e
))
}
else
{
fs
.
ensureFile
(
path
).
then
(()
=>
{
fs
.
writeFile
(
path
,
args
.
content
,
'utf8'
,
(
error
,
data
)
=>
{
if
(
error
)
console
.
log
(
error
)
cb
(
error
,
data
)
})
}).
catch
(
e
=>
cb
(
e
))
}
},
rename
:
function
(
args
,
cb
)
{
...
...
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