remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remix-ide/ci/publishIpfs

18 lines
485 B

4 years ago
#!/usr/bin/env node
const IpfsHttpClient = require('ipfs-http-client')
const { globSource } = IpfsHttpClient
const folder = process.cwd() + '/dist/apps/remix-ide';
4 years ago
(async () => {
const host = 'ipfs.infura.io'
const ipfs = IpfsHttpClient({ host, port: 5001, protocol: 'https' })
4 years ago
try {
4 years ago
let result = await ipfs.add(globSource(folder, { recursive: true}), { pin: false })
const hash = result.cid.toString()
console.log(hash)
4 years ago
} catch (e) {
console.log(e)
}
})()