1- import { Arch , copyFile , dirSize , log } from "builder-util"
1+ import { Arch , copyFile , dirSize , isEmptyOrSpaces , log } from "builder-util"
22import { PackageFileInfo } from "builder-util-runtime"
33import * as fs from "fs/promises"
44import * as path from "path"
@@ -20,10 +20,10 @@ export const NsisTargetOptions = (() => {
2020} ) ( )
2121
2222export const NSIS_PATH = ( ) => {
23- const custom = process . env . ELECTRON_BUILDER_NSIS_DIR
24- if ( custom != null && custom . length > 0 ) {
25- log . info ( { path : custom . trim ( ) } , "using local nsis" )
26- return Promise . resolve ( custom . trim ( ) )
23+ const custom = process . env . ELECTRON_BUILDER_NSIS_DIR ?. trim ( )
24+ if ( ! isEmptyOrSpaces ( custom ) ) {
25+ log . info ( { path : custom } , "using local nsis" )
26+ return Promise . resolve ( custom )
2727 }
2828 return NsisTargetOptions . then ( ( options : NsisOptions ) => {
2929 if ( options . customNsisBinary ) {
@@ -39,10 +39,10 @@ export const NSIS_PATH = () => {
3939}
4040
4141export const NSIS_RESOURCES_PATH = ( ) => {
42- const custom = process . env . ELECTRON_BUILDER_NSIS_RESOURCES_DIR
43- if ( custom != null && custom . length > 0 ) {
44- log . info ( { path : custom . trim ( ) } , "using local nsis-resources" )
45- return Promise . resolve ( custom . trim ( ) )
42+ const custom = process . env . ELECTRON_BUILDER_NSIS_RESOURCES_DIR ?. trim ( )
43+ if ( ! isEmptyOrSpaces ( custom ) ) {
44+ log . info ( { path : custom } , "using local nsis-resources" )
45+ return Promise . resolve ( custom )
4646 }
4747 return NsisTargetOptions . then ( ( options : NsisOptions ) => {
4848 if ( options . customNsisResources ) {
0 commit comments