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
b1aa0deb
Commit
b1aa0deb
authored
Apr 03, 2020
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing Publish to gist
parent
c56ac921
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
file-explorer.js
src/app/files/file-explorer.js
+13
-9
fileProvider.js
src/app/files/fileProvider.js
+4
-0
No files found.
src/app/files/file-explorer.js
View file @
b1aa0deb
...
@@ -488,7 +488,7 @@ fileExplorer.prototype.toGist = function (id) {
...
@@ -488,7 +488,7 @@ fileExplorer.prototype.toGist = function (id) {
this
.
packageFiles
(
this
.
files
,
folder
,
(
error
,
packaged
)
=>
{
this
.
packageFiles
(
this
.
files
,
folder
,
(
error
,
packaged
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
)
modalDialogCustom
.
alert
(
'Failed to create gist: '
+
error
.
message
)
}
else
{
}
else
{
// check for token
// check for token
var
tokenAccess
=
this
.
_deps
.
config
.
get
(
'settings/gist-access-token'
)
var
tokenAccess
=
this
.
_deps
.
config
.
get
(
'settings/gist-access-token'
)
...
@@ -550,19 +550,23 @@ fileExplorer.prototype.toGist = function (id) {
...
@@ -550,19 +550,23 @@ fileExplorer.prototype.toGist = function (id) {
// return all the files, except the temporary/readonly ones..
// return all the files, except the temporary/readonly ones..
fileExplorer
.
prototype
.
packageFiles
=
function
(
filesProvider
,
directory
,
callback
)
{
fileExplorer
.
prototype
.
packageFiles
=
function
(
filesProvider
,
directory
,
callback
)
{
var
ret
=
{}
let
ret
=
{}
filesProvider
.
resolveDirectory
(
directory
,
(
error
,
files
)
=>
{
filesProvider
.
resolveDirectory
(
directory
,
(
error
,
files
)
=>
{
if
(
error
)
callback
(
error
)
if
(
error
)
callback
(
error
)
else
{
else
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
async
.
eachSeries
(
Object
.
keys
(
files
),
(
path
,
cb
)
=>
{
filesProvider
.
get
(
path
,
(
error
,
content
)
=>
{
if
(
filesProvider
.
isDirectory
(
path
))
{
if
(
error
)
return
cb
(
error
)
if
(
/^
\s
+$/
.
test
(
content
)
||
!
content
.
length
)
{
content
=
'// this line is added to create a gist. Empty file is not allowed.'
}
ret
[
path
]
=
{
content
}
cb
()
cb
()
})
}
else
{
filesProvider
.
get
(
path
,
(
error
,
content
)
=>
{
if
(
error
)
return
cb
(
error
)
if
(
/^
\s
+$/
.
test
(
content
)
||
!
content
.
length
)
{
content
=
'// this line is added to create a gist. Empty file is not allowed.'
}
ret
[
path
]
=
{
content
}
cb
()
})
}
},
(
error
)
=>
{
},
(
error
)
=>
{
callback
(
error
,
ret
)
callback
(
error
,
ret
)
})
})
...
...
src/app/files/fileProvider.js
View file @
b1aa0deb
...
@@ -133,6 +133,10 @@ class FileProvider {
...
@@ -133,6 +133,10 @@ class FileProvider {
return
false
return
false
}
}
isDirectory
(
path
)
{
return
window
.
remixFileSystem
.
statSync
(
path
).
isDirectory
()
}
/**
/**
* Removes the folder recursively
* Removes the folder recursively
* @param {*} path is the folder to be removed
* @param {*} path is the folder to be removed
...
...
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