diff --git a/dist/index.js b/dist/index.js index 2f39fc8b..80b952b9 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 24ccab55..29d28ca3 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/unity-versioning.test.ts b/src/model/unity-versioning.test.ts index 7a87393a..94aa3c6a 100644 --- a/src/model/unity-versioning.test.ts +++ b/src/model/unity-versioning.test.ts @@ -14,8 +14,8 @@ describe('Unity Versioning', () => { }); describe('read', () => { - it('does not throw', () => { - expect(() => UnityVersioning.read('')).not.toThrow(); + it('throws for invalid path', () => { + expect(() => UnityVersioning.read('')).toThrow(Error); }); it('reads from test-project', () => { diff --git a/src/model/unity-versioning.ts b/src/model/unity-versioning.ts index 7b98e0ab..6bf07081 100644 --- a/src/model/unity-versioning.ts +++ b/src/model/unity-versioning.ts @@ -1,4 +1,3 @@ -import * as core from '@actions/core'; import * as fs from 'fs'; import path from 'path'; @@ -17,8 +16,7 @@ export default class UnityVersioning { static read(projectPath) { const filePath = path.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt'); if (!fs.existsSync(filePath)) { - core.warning(`Could not find "${filePath}", keeping unityVersion as "auto"`); - return 'auto'; + throw new Error(`Project settings file not found at "${filePath}". Have you correctly set the projectPath?`); } return UnityVersioning.parse(fs.readFileSync(filePath, 'utf8')); }