Use boolean
parent
3e4f343b07
commit
aab7c4f710
|
@ -6831,7 +6831,8 @@ class Input {
|
|||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||
}
|
||||
static get manualExit() {
|
||||
return Input.getInput('manualExit');
|
||||
const input = Input.getInput('manualExit') || false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get customParameters() {
|
||||
return Input.getInput('customParameters') || '';
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -119,7 +119,7 @@ echo ""
|
|||
|
||||
unity-editor \
|
||||
-logfile /dev/stdout \
|
||||
$( [ -n "${MANUAL_EXIT+set}" ] || echo "-quit" ) \
|
||||
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
||||
-customBuildName "$BUILD_NAME" \
|
||||
-projectPath "$UNITY_PROJECT_PATH" \
|
||||
-buildTarget "$BUILD_TARGET" \
|
||||
|
|
|
@ -29,7 +29,7 @@ class BuildParameters {
|
|||
public buildFile!: string;
|
||||
public buildMethod!: string;
|
||||
public buildVersion!: string;
|
||||
public manualExit!: string | undefined;
|
||||
public manualExit!: boolean;
|
||||
public androidVersionCode!: string;
|
||||
public androidKeystoreName!: string;
|
||||
public androidKeystoreBase64!: string;
|
||||
|
|
|
@ -106,13 +106,18 @@ describe('Input', () => {
|
|||
|
||||
describe('manualExit', () => {
|
||||
it('returns the default value', () => {
|
||||
expect(Input.manualExit).toStrictEqual(undefined);
|
||||
expect(Input.manualExit).toStrictEqual(false);
|
||||
});
|
||||
|
||||
it('takes input from the users workflow', () => {
|
||||
const mockValue = 'x';
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
||||
expect(Input.manualExit).toStrictEqual(mockValue);
|
||||
it('returns true when string true is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||
expect(Input.manualExit).toStrictEqual(true);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('returns false when string false is passed', () => {
|
||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue('false');
|
||||
expect(Input.manualExit).toStrictEqual(false);
|
||||
expect(spy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -126,8 +126,10 @@ class Input {
|
|||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||
}
|
||||
|
||||
static get manualExit(): string | undefined {
|
||||
return Input.getInput('manualExit');
|
||||
static get manualExit(): boolean {
|
||||
const input = Input.getInput('manualExit') || false;
|
||||
|
||||
return input === 'true';
|
||||
}
|
||||
|
||||
static get customParameters(): string {
|
||||
|
|
Loading…
Reference in New Issue