mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-23 15:18:30 +00:00
Check if unix before doing singleIco
This commit is contained in:
parent
79c7767bb0
commit
dab00a80e6
@ -30,6 +30,7 @@ function iconBuild(options, callback) {
|
||||
|
||||
if (options.platform === 'win32') {
|
||||
if (!iconIsIco(options.icon)) {
|
||||
console.warn('Icon should be an .ico to package for Windows');
|
||||
returnCallback();
|
||||
return;
|
||||
}
|
||||
@ -40,7 +41,7 @@ function iconBuild(options, callback) {
|
||||
returnCallback();
|
||||
})
|
||||
.catch(error => {
|
||||
console.warn('Skipping process to make .ico icon contain only a single image: ', error);
|
||||
console.warn('Skipping process to make .ico icon contain only a single image:', error);
|
||||
returnCallback();
|
||||
});
|
||||
return;
|
||||
|
@ -1,6 +1,8 @@
|
||||
import shell from 'shelljs';
|
||||
import path from 'path';
|
||||
import tmp from 'tmp';
|
||||
import helpers from './helpers';
|
||||
const {isWindows} = helpers;
|
||||
|
||||
tmp.setGracefulCleanup();
|
||||
|
||||
@ -13,6 +15,11 @@ const EXTRACT_ICO_PATH = path.join(__dirname, '../..', 'bin/singleIco');
|
||||
*/
|
||||
function singleIco(icoSrc, dest) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isWindows()) {
|
||||
reject('OSX or Linux is required');
|
||||
return;
|
||||
}
|
||||
|
||||
shell.exec(`${EXTRACT_ICO_PATH} ${icoSrc} ${dest}`, {silent: true}, (exitCode, stdOut, stdError) => {
|
||||
if (stdOut.includes('icon.iconset:error') || exitCode) {
|
||||
if (exitCode) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user