mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-10 17:24:39 +00:00
Expose main instead of buildApp
This commit is contained in:
parent
b7433dfc3b
commit
9c19c144e7
@ -9,7 +9,7 @@
|
||||
"native",
|
||||
"wrapper"
|
||||
],
|
||||
"main": "lib/buildApp.js",
|
||||
"main": "./index.js",
|
||||
"scripts": {
|
||||
"dev-up": "npm install && (cd app && npm install)",
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
|
41
src/cli.js
41
src/cli.js
@ -2,48 +2,9 @@
|
||||
|
||||
import path from 'path';
|
||||
import program from 'commander';
|
||||
import async from 'async';
|
||||
|
||||
import optionsFactory from './options';
|
||||
import buildApp from './buildApp';
|
||||
|
||||
import main from './main'
|
||||
const packageJson = require(path.join('..', 'package'));
|
||||
|
||||
function main(program) {
|
||||
|
||||
async.waterfall([
|
||||
callback => {
|
||||
optionsFactory(
|
||||
program.appName,
|
||||
program.targetUrl,
|
||||
program.platform,
|
||||
program.arch,
|
||||
program.electronVersion,
|
||||
program.outDir,
|
||||
program.overwrite,
|
||||
program.conceal,
|
||||
program.icon,
|
||||
program.counter,
|
||||
program.width,
|
||||
program.height,
|
||||
program.userAgent,
|
||||
program.honest,
|
||||
callback);
|
||||
},
|
||||
|
||||
(options, callback) => {
|
||||
buildApp(options, callback);
|
||||
}
|
||||
], (error, appPath) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`App built to ${appPath}`);
|
||||
});
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
program
|
||||
.version(packageJson.version)
|
||||
|
38
src/main.js
Normal file
38
src/main.js
Normal file
@ -0,0 +1,38 @@
|
||||
import optionsFactory from './options';
|
||||
import buildApp from './buildApp';
|
||||
import async from 'async';
|
||||
|
||||
export default function main(program) {
|
||||
|
||||
async.waterfall([
|
||||
callback => {
|
||||
optionsFactory(
|
||||
program.appName,
|
||||
program.targetUrl,
|
||||
program.platform,
|
||||
program.arch,
|
||||
program.electronVersion,
|
||||
program.outDir,
|
||||
program.overwrite,
|
||||
program.conceal,
|
||||
program.icon,
|
||||
program.counter,
|
||||
program.width,
|
||||
program.height,
|
||||
program.userAgent,
|
||||
program.honest,
|
||||
callback);
|
||||
},
|
||||
|
||||
(options, callback) => {
|
||||
buildApp(options, callback);
|
||||
}
|
||||
], (error, appPath) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`App built to ${appPath}`);
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user