ghost-portal/packages/app-accounts/scripts/vanitygen.js
Jaco Greeff 6611577a86
Move vanity generation to accounts app (#603)
* Bare code move from app-vanitygen

* Dirty, but vanity shows up

* Add directly from vanity
2019-01-15 09:37:35 +01:00

29 lines
854 B
JavaScript
Executable File

#!/usr/bin/env node
// Copyright 2017-2019 @polkadot/app-accounts authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
const fs = require('fs');
const path = require('path');
const [compiled] = ['../vanitygen/cli.js']
.map((file) => path.join(__dirname, file))
.filter((file) => fs.existsSync(file));
if (compiled) {
require(compiled);
} else {
require('@babel/register')({
extensions: ['.js', '.ts'],
plugins: [
['module-resolver', {
alias: {
'^@polkadot/client-(chains|db-chain|db|p2p-messages|p2p|rpc-handlers|rpc|runtime|telemetry|wasm)(.*)': './packages/client-\\1/src\\2',
'^@polkadot/client(.*)': './packages/client/src\\1'
}
}]
]
});
require('../src/vanitygen/cli.ts');
}