ghost-portal/packages/app-accounts/scripts/vanitygen.js
2019-09-12 16:32:40 +02:00

27 lines
694 B
JavaScript
Executable File

#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */
// 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: {}
}]
]
});
require('../src/vanitygen/cli.ts');
}