Skip to content

Commit

Permalink
feat: slb support inline content
Browse files Browse the repository at this point in the history
  • Loading branch information
reruin committed Mar 15, 2021
1 parent fcc6dd7 commit 80d7de1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/plugins/drive.sld.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ module.exports = ({isObject , isArray}) => {
let resp = { id, type: 'folder', protocol: defaultProtocol }

let json = yaml.parse(data)

json = createId(json, id)
resp.children = json
resp.updated_at = Date.now()
Expand All @@ -95,18 +94,26 @@ module.exports = ({isObject , isArray}) => {
}
}) //[ parseInt(path[i]) ]
}

return disk
}else{
return []
}
}

const folder = async (id,{ content } = {}) => {
if(content){
return mount(id,content)
}else{
return findById(id)
try{
let json = yaml.parse(id)
if(json && typeof json == 'object'){
return mount(null,id)
}else{
throw new Error("")
}
}catch(e){
if(content){
return mount(id,content)
}else{
return findById(id)
}
}
}

Expand Down

0 comments on commit 80d7de1

Please sign in to comment.