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
1c89823e
Commit
1c89823e
authored
Sep 09, 2021
by
bunsenstraat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always push to remix ipfs too
parent
a921c4f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
dgitProvider.js
apps/remix-ide/src/app/files/dgitProvider.js
+16
-7
No files found.
apps/remix-ide/src/app/files/dgitProvider.js
View file @
1c89823e
...
...
@@ -122,6 +122,7 @@ class DGitProvider extends Plugin {
try
{
remotes
=
await
git
.
listRemotes
({
...
await
this
.
getGitConfig
()
})
}
catch
(
e
)
{
console
.
log
(
e
)
}
return
remotes
}
...
...
@@ -142,7 +143,7 @@ class DGitProvider extends Plugin {
return
name
}
async
branches
(
input
)
{
async
branches
()
{
const
cmd
=
{
...
await
this
.
getGitConfig
()
}
...
...
@@ -165,7 +166,9 @@ class DGitProvider extends Plugin {
...
cmd
})
return
sha
}
catch
(
e
)
{
}
}
catch
(
e
)
{
throw
new
Error
(
e
)
}
}
async
lsfiles
(
cmd
)
{
...
...
@@ -291,8 +294,8 @@ class DGitProvider extends Plugin {
return
result
}
async
export
()
{
if
(
!
this
.
checkIpfsConfig
())
return
false
async
export
(
config
)
{
if
(
!
this
.
checkIpfsConfig
(
config
))
return
false
const
workspace
=
await
this
.
call
(
'filePanel'
,
'getCurrentWorkspace'
)
const
files
=
await
this
.
getDirectory
(
'/'
)
this
.
filesToSend
=
[]
...
...
@@ -360,7 +363,7 @@ class DGitProvider extends Plugin {
data
.
append
(
'pinataMetadata'
,
metadata
)
const
url
=
'https://api.pinata.cloud/pinning/pinFileToIPFS'
try
{
const
result
=
await
axios
await
axios
.
post
(
url
,
data
,
{
maxBodyLength
:
'Infinity'
,
headers
:
{
...
...
@@ -369,7 +372,8 @@ class DGitProvider extends Plugin {
pinata_secret_api_key
:
pinataSecretApiKey
}
})
return
result
.
data
.
IpfsHash
// also commit to remix IPFS for availability after pinning to Pinata
return
await
this
.
export
(
this
.
remixIPFS
)
}
catch
(
error
)
{
throw
new
Error
(
error
)
}
...
...
@@ -458,7 +462,12 @@ class DGitProvider extends Plugin {
const
cid
=
cmd
.
cid
await
this
.
call
(
'filePanel'
,
'createWorkspace'
,
`workspace_
${
Date
.
now
()}
`
,
false
)
const
workspace
=
await
this
.
call
(
'filePanel'
,
'getCurrentWorkspace'
)
const
result
=
await
this
.
importIPFSFiles
(
this
.
globalIPFSConfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
ipfsconfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
remixIPFS
,
cid
,
workspace
)
let
result
if
(
cmd
.
local
)
{
result
=
await
this
.
importIPFSFiles
(
this
.
ipfsconfig
,
cid
,
workspace
)
}
else
{
result
=
await
this
.
importIPFSFiles
(
this
.
remixIPFS
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
ipfsconfig
,
cid
,
workspace
)
||
await
this
.
importIPFSFiles
(
this
.
globalIPFSConfig
,
cid
,
workspace
)
}
await
this
.
call
(
'fileManager'
,
'refresh'
)
if
(
!
result
)
throw
new
Error
(
`Cannot pull files from IPFS at
${
cid
}
`
)
}
...
...
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