Skip to content

Commit

Permalink
Handled batch parameters better
Browse files Browse the repository at this point in the history
and fixed error in appveyor config file
  • Loading branch information
L4ZZA committed Jul 12, 2020
1 parent 897ada4 commit fd02760
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ install:

before_build:
# Generate VS2019 solution
- cmd: '%SCRIPTS%\generate_solution_vs2019.bat %CONFIG_PARTIAL% -s'
- cmd: '%SCRIPTS%\generate_solution_vs2019.bat -s'


#---------------------------------#
Expand All @@ -112,7 +112,7 @@ after_build:
# show content of test dir to see if report is created.
- cmd: 'dir bin\%CONFIG_PARTIAL%-%OS_PARTIAL%-%PLAT_PARTIAL%\tests'
# Create installer [it works because appveyor image comes with NSIS installed]
- cmd: '%SCRIPTS%\create_installer.bat -s'
- cmd: '%SCRIPTS%\create_installer.bat %CONFIG_PARTIAL% -s'
# Renaming installer to include version in its name
- cmd: 'ren %OUTPUT_FOLDER%\installers\%PRODUCT_NAME%Setup.exe "%PRODUCT_NAME%-%FILE_VERSION%-setup.exe"'

Expand Down
14 changes: 11 additions & 3 deletions scripts/create_installer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,26 @@
@rem Prevent env variables to escape to the calling environment
SETLOCAL

@rem redefine variables in case already defined in the calling environment
SET CONFIG=%~1
SET DEFAULT_CONFIG=Release
SET SILENT_MODE=false

IF "%CONFIG%" == "" (
SET CONFIG=%DEFAULT_CONFIG%
echo No Configuration passed. Defaulted to %CONFIG%
echo Usage: create_installer.bat ^<configuration^> [-s]
) ELSE IF "%CONFIG%" == "-s" (
SET SILENT_MODE=true
SET CONFIG=%DEFAULT_CONFIG%
echo No Configuration passed. Defaulted to %CONFIG%
echo Usage: create_installer.bat ^<configuration^> [-s]
) ELSE IF "%CONFIG:~0,1%" == "-" (
SET CONFIG=%DEFAULT_CONFIG%
echo No Configuration passed. Defaulted to %CONFIG%
echo Usage: create_installer.bat ^<configuration^> [-s]
)

@rem redefine variables in case already defined in the calling environment
SET SILENT_MODE=false

SHIFT
:args
SET PARAM=%~1
Expand Down

0 comments on commit fd02760

Please sign in to comment.