mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-11 07:41:04 +00:00
parent
84dcde9d5b
commit
ede0bd8ca6
12
src/cli.js
12
src/cli.js
@ -4,6 +4,7 @@ import 'source-map-support/register';
|
||||
import program from 'commander';
|
||||
import nativefier from './index';
|
||||
|
||||
const dns = require('dns');
|
||||
const packageJson = require('./../package');
|
||||
|
||||
function collect(val, memo) {
|
||||
@ -23,6 +24,15 @@ function getProcessEnvs(val) {
|
||||
return pEnv;
|
||||
}
|
||||
|
||||
function checkInternet() {
|
||||
dns.lookup('npmjs.com', (err) => {
|
||||
if (err && err.code === 'ENOTFOUND') {
|
||||
console.log('\nNo Internet Connection\nTo offline build, download electron from https://github.com/electron/electron/releases\nand place in ~/AppData/Local/electron/Cache/ on Windows,\n~/.cache/electron on Linux or ~/Library/Caches/electron/ on Mac\nUse --electron-version to specify the version you downloaded.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (require.main === module) {
|
||||
program
|
||||
.version(packageJson.version)
|
||||
@ -77,7 +87,7 @@ if (require.main === module) {
|
||||
if (!process.argv.slice(2).length) {
|
||||
program.help();
|
||||
}
|
||||
|
||||
checkInternet();
|
||||
nativefier(program, (error, appPath) => {
|
||||
if (error) {
|
||||
console.error(error);
|
||||
|
Loading…
Reference in New Issue
Block a user