mirror of
https://github.com/mempool/mempool.git
synced 2025-01-17 18:52:34 +01:00
parent
11b1d9bbd3
commit
ac9e718ef1
4
frontend/.gitignore
vendored
4
frontend/.gitignore
vendored
@ -44,3 +44,7 @@ testem.log
|
||||
# System Files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
src/assets/assets.json
|
||||
src/assets/assets.minimal.json
|
||||
src/assets/asset.icons.json
|
||||
|
@ -21,8 +21,10 @@
|
||||
"main": "index.ts",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve --proxy-config proxy.conf.json",
|
||||
"build": "ng build --prod",
|
||||
"start": "npm run sync-assets-dev && ng serve --proxy-config proxy.conf.json",
|
||||
"build": "ng build --prod && npm run sync-assets",
|
||||
"sync-assets": "node sync-asset-registry.js",
|
||||
"sync-assets-dev": "node sync-asset-registry.js dev",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
|
21
frontend/sync-asset-registry.js
Normal file
21
frontend/sync-asset-registry.js
Normal file
@ -0,0 +1,21 @@
|
||||
var https = require('https');
|
||||
var fs = require('fs');
|
||||
|
||||
var PATH = 'dist/mempool/assets/';
|
||||
if (process.argv[2] && process.argv[2] === 'dev') {
|
||||
PATH = 'src/assets/';
|
||||
}
|
||||
|
||||
function download(filename, url) {
|
||||
var file = fs.createWriteStream(filename);
|
||||
https.get(url, function(response) {
|
||||
response.pipe(file);
|
||||
});
|
||||
}
|
||||
|
||||
console.log('Downloading assets');
|
||||
download(PATH + 'assets.json', 'https://raw.githubusercontent.com/Blockstream/asset_registry_db/master/index.json');
|
||||
console.log('Downloading assets minimal');
|
||||
download(PATH + 'assets.minimal.json', 'https://raw.githubusercontent.com/Blockstream/asset_registry_db/master/index.minimal.json');
|
||||
console.log('Downloading asset icons');
|
||||
download(PATH + 'asset.icons.json', 'https://raw.githubusercontent.com/Blockstream/asset_registry_db/master/icons.json');
|
Loading…
Reference in New Issue
Block a user