SIGN IN SIGN UP
tw93 / Pake UNCLAIMED

🤱🏻 Turn any webpage into a desktop app with one command.

import log from 'loglevel';
import updateNotifier from 'update-notifier';
import packageJson from '../package.json';
2023-06-22 14:36:02 +08:00
import BuilderProvider from './builders/BuilderProvider';
2023-06-23 13:15:49 +08:00
import handleInputOptions from './options/index';
import { getCliProgram } from './helpers/cli-program';
2023-06-23 13:15:49 +08:00
import { PakeCliOptions } from './types';
2022-11-22 00:24:06 +08:00
const program = getCliProgram();
async function checkUpdateTips() {
updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify({
isGlobal: true,
});
}
program.action(async (url: string, options: PakeCliOptions) => {
await checkUpdateTips();
if (!url) {
program.help({
error: false,
});
return;
}
log.setDefaultLevel('info');
log.setLevel('info');
if (options.debug) {
log.setLevel('debug');
}
const appOptions = await handleInputOptions(options, url);
2022-11-22 00:24:06 +08:00
const builder = BuilderProvider.create(appOptions);
await builder.prepare();
await builder.build(url);
});
2022-11-22 00:24:06 +08:00
program.parse();