Skip to content

Commit

Permalink
fix: dir is always a directory
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
  • Loading branch information
hacdias committed Jun 4, 2021
1 parent 18234f3 commit c3fd85c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/pinners/fission.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ const path = require('path')
const BASE_URL = 'https://runfission.com/ipfs'
const headers = { 'content-type': 'application/octet-stream' }

const uploadFile = async (auth, filepath) => {
const resp = await axios.post(BASE_URL, fs.createReadStream(filepath), {
maxContentLength: 'Infinity',
auth,
headers
})
return resp.data
}

const putDAGObj = async (auth, node) => {
const resp = await axios.post(`${BASE_URL}/dag`, JSON.stringify(node), {
auth,
Expand All @@ -36,10 +27,6 @@ class Fission {
}

async pinDir (dir, tag) {
if (!fs.statSync(dir).isDirectory()) {
return uploadFile(this.auth, dir)
}

const files = fs.readdirSync(dir)
const links = await Promise.all(
files.map(async file => {
Expand Down

0 comments on commit c3fd85c

Please sign in to comment.