mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-07 20:35:33 -04:00
Use boolean
This commit is contained in:
parent
3e4f343b07
commit
aab7c4f710
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
2
dist/platforms/ubuntu/steps/build.sh
vendored
2
dist/platforms/ubuntu/steps/build.sh
vendored
@ -119,7 +119,7 @@ echo ""
|
|||||||
|
|
||||||
unity-editor \
|
unity-editor \
|
||||||
-logfile /dev/stdout \
|
-logfile /dev/stdout \
|
||||||
$( [ -n "${MANUAL_EXIT+set}" ] || echo "-quit" ) \
|
$( [ "${MANUAL_EXIT}" == "true" ] || echo "-quit" ) \
|
||||||
-customBuildName "$BUILD_NAME" \
|
-customBuildName "$BUILD_NAME" \
|
||||||
-projectPath "$UNITY_PROJECT_PATH" \
|
-projectPath "$UNITY_PROJECT_PATH" \
|
||||||
-buildTarget "$BUILD_TARGET" \
|
-buildTarget "$BUILD_TARGET" \
|
||||||
|
@ -29,7 +29,7 @@ class BuildParameters {
|
|||||||
public buildFile!: string;
|
public buildFile!: string;
|
||||||
public buildMethod!: string;
|
public buildMethod!: string;
|
||||||
public buildVersion!: string;
|
public buildVersion!: string;
|
||||||
public manualExit!: string | undefined;
|
public manualExit!: boolean;
|
||||||
public androidVersionCode!: string;
|
public androidVersionCode!: string;
|
||||||
public androidKeystoreName!: string;
|
public androidKeystoreName!: string;
|
||||||
public androidKeystoreBase64!: string;
|
public androidKeystoreBase64!: string;
|
||||||
|
@ -106,13 +106,18 @@ describe('Input', () => {
|
|||||||
|
|
||||||
describe('manualExit', () => {
|
describe('manualExit', () => {
|
||||||
it('returns the default value', () => {
|
it('returns the default value', () => {
|
||||||
expect(Input.manualExit).toStrictEqual(undefined);
|
expect(Input.manualExit).toStrictEqual(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('returns true when string true is passed', () => {
|
||||||
const mockValue = 'x';
|
const spy = jest.spyOn(core, 'getInput').mockReturnValue('true');
|
||||||
const spy = jest.spyOn(core, 'getInput').mockReturnValue(mockValue);
|
expect(Input.manualExit).toStrictEqual(true);
|
||||||
expect(Input.manualExit).toStrictEqual(mockValue);
|
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);
|
expect(spy).toHaveBeenCalledTimes(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -126,8 +126,10 @@ class Input {
|
|||||||
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
return Input.getInput('buildMethod') || ''; // Processed in docker file
|
||||||
}
|
}
|
||||||
|
|
||||||
static get manualExit(): string | undefined {
|
static get manualExit(): boolean {
|
||||||
return Input.getInput('manualExit');
|
const input = Input.getInput('manualExit') || false;
|
||||||
|
|
||||||
|
return input === 'true';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get customParameters(): string {
|
static get customParameters(): string {
|
||||||
|
Loading…
Reference in New Issue
Block a user