comply with linter

pull/1/head
Iuri Matias 7 years ago
parent 0a92ea29c3
commit b28eb6222a
  1. 4
      src/app.js
  2. 56
      src/app/compiler/compiler-imports.js

@ -201,10 +201,10 @@ function run () {
if (provider && provider.exists(url)) { if (provider && provider.exists(url)) {
return provider.get(url, cb) return provider.get(url, cb)
} }
handleImports.import(url, handleImports.import(url,
(loadingMsg) => { (loadingMsg) => {
$('#output').append($('<div/>').append($('<pre/>').text(loadingMsg))) $('#output').append($('<div/>').append($('<pre/>').text(loadingMsg)))
} },
(error, content, cleanUrl, type, url) => { (error, content, cleanUrl, type, url) => {
if (!error) { if (!error) {
filesProviders[type].addReadOnly(cleanUrl, content, url) filesProviders[type].addReadOnly(cleanUrl, content, url)

@ -6,22 +6,23 @@ var request = require('request')
module.exports = { module.exports = {
handleGithubCall: function (root, path, cb) { handleGithubCall: function (root, path, cb) {
return request.get( return request.get(
{ {
url: 'https://api.github.com/repos/' + root + '/contents/' + path, url: 'https://api.github.com/repos/' + root + '/contents/' + path,
json: true, json: true,
headers: { headers: {
'User-Agent': 'Remix' 'User-Agent': 'Remix'
} }
}, (err, r, data) => { },
if (err) { (err, r, data) => {
return cb(err || 'Unknown transport error') if (err) {
} return cb(err || 'Unknown transport error')
if ('content' in data) { }
cb(null, base64.decode(data.content), root + '/' + path) if ('content' in data) {
} else { cb(null, base64.decode(data.content), root + '/' + path)
cb('Content not received') } else {
} cb('Content not received')
}); }
})
}, },
handleSwarmImport: function (url, cb) { handleSwarmImport: function (url, cb) {
@ -35,17 +36,18 @@ module.exports = {
url = url.replace(/^ipfs:\/\/?/, 'ipfs/') url = url.replace(/^ipfs:\/\/?/, 'ipfs/')
return request.get( return request.get(
{ {
url: 'https://gateway.ipfs.io/' + url, url: 'https://gateway.ipfs.io/' + url,
headers: { headers: {
'User-Agent': 'Remix' 'User-Agent': 'Remix'
} }
}, (err, r, data) => { },
if (err) { (err, r, data) => {
return cb(err || 'Unknown transport error') if (err) {
} return cb(err || 'Unknown transport error')
cb(null, data, url) }
}) cb(null, data, url)
})
}, },
handlers: function () { handlers: function () {

Loading…
Cancel
Save