|
|
|
@ -16,7 +16,7 @@ import * as child_process from 'child_process' |
|
|
|
|
let sha_field = 'sha_' + build |
|
|
|
|
let url_field = 'url_' + build |
|
|
|
|
|
|
|
|
|
if(build === 'live') { |
|
|
|
|
if (build === 'live') { |
|
|
|
|
sha_field = 'sha' |
|
|
|
|
url_field = 'url' |
|
|
|
|
} |
|
|
|
@ -32,15 +32,15 @@ import * as child_process from 'child_process' |
|
|
|
|
const plugins = await metadata.json() |
|
|
|
|
let plugin = plugins.find((p: any) => p.name === pluginName) |
|
|
|
|
let profileJSON: any = null |
|
|
|
|
try{ |
|
|
|
|
try { |
|
|
|
|
profileJSON = JSON.parse(fs.readFileSync(`apps/${pluginName}/profile.json`, 'utf8')) |
|
|
|
|
}catch(e){ |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log('local profile.json not found') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!plugin) { |
|
|
|
|
console.error('plugin not found in the directory, attempting to create it...') |
|
|
|
|
if(!profileJSON){ |
|
|
|
|
if (!profileJSON) { |
|
|
|
|
console.error('create a profile.json file in the plugin folder') |
|
|
|
|
process.exit(1) |
|
|
|
|
} |
|
|
|
@ -66,9 +66,11 @@ import * as child_process from 'child_process' |
|
|
|
|
const projectSecret = process.env.infura_project_secret |
|
|
|
|
const auth = 'Basic ' + Buffer.from(projectId + ':' + projectSecret).toString('base64') |
|
|
|
|
|
|
|
|
|
const ipfs = IpfsHttpClient({ port: 5001, host, protocol: 'https', headers: { |
|
|
|
|
const ipfs = IpfsHttpClient({ |
|
|
|
|
port: 5001, host, protocol: 'https', headers: { |
|
|
|
|
authorization: auth |
|
|
|
|
} }) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
const { globSource } = IpfsHttpClient |
|
|
|
|
const folder = `dist/apps/${pluginName}` |
|
|
|
|
|
|
|
|
@ -83,8 +85,9 @@ import * as child_process from 'child_process' |
|
|
|
|
const plugin_directory_path = 'remix-plugins-directory/plugins/' |
|
|
|
|
|
|
|
|
|
// create the plugin directory if it doesn't exist
|
|
|
|
|
const exists = fs.statSync(plugin_directory_path + pluginName).isDirectory() |
|
|
|
|
if(!exists){ |
|
|
|
|
try { |
|
|
|
|
fs.statSync(plugin_directory_path + pluginName).isDirectory() |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log('creating plugin directory') |
|
|
|
|
fs.mkdirSync(plugin_directory_path + pluginName) |
|
|
|
|
} |
|
|
|
|