mirror of
				https://github.com/chickensoft-games/setup-godot.git
				synced 2025-10-31 15:33:55 +00:00 
			
		
		
		
	fix: get tests working again locally on macOS, update readme to show new feature (#23)
* docs: update readme * fix: get tests passing on macOS locally by normalizing path
This commit is contained in:
		
							parent
							
								
									9f83926bad
								
							
						
					
					
						commit
						fe0bfb4b4b
					
				| @ -4,11 +4,12 @@ | ||||
| 
 | ||||
| Setup Godot for use with (or without) .NET on macOS, Windows, and Linux CI/CD runners. | ||||
| 
 | ||||
| - ✅ Godot 4.x | ||||
| - ✅ Installs Godot 4.x | ||||
| - ✅ Installs export templates. | ||||
| - ✅ C# supported using .NET version of Godot. | ||||
| - ✅ Versions **without** .NET are also supported. | ||||
| - ✅ Installs Godot directly on the CI/CD runner. | ||||
| - ✅ Caches Godot installation for speedier workflows. | ||||
| - ✅ Caches Godot and export template installation for speedier workflows. | ||||
| - ✅ Adds environment variables (`GODOT4`, `GODOT`) to the system path. | ||||
| - ✅ Runs on macOS Github Actions runner. | ||||
| - ✅ Runs on Windows Github Actions runner. | ||||
|  | ||||
| @ -1,8 +1,13 @@ | ||||
| import {describe, expect, test} from '@jest/globals' | ||||
| import path from 'path' | ||||
| import os from 'os' | ||||
| import path from 'path' | ||||
| 
 | ||||
| import {getGodotUrl, getPlatform, parseVersion, getExportTemplatePath} from '../src/utils' | ||||
| import { | ||||
|   getExportTemplatePath, | ||||
|   getGodotUrl, | ||||
|   getPlatform, | ||||
|   parseVersion | ||||
| } from '../src/utils' | ||||
| 
 | ||||
| describe('parseVersion', () => { | ||||
|   test('parses valid godot versions', () => { | ||||
| @ -32,38 +37,58 @@ describe('parseVersion', () => { | ||||
| describe('getGodotUrl', () => { | ||||
|   describe('useDotnet = true', () => { | ||||
|     test('4.0.0-beta1', () => { | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_linux_x86_64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('win32'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('win32'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_win64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('darwin'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('darwin'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_macos.universal.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, true)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('linux'), true, true) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_export_templates.tpz' | ||||
|       ) | ||||
|     }) | ||||
|     test('4.0.0-beta.16', () => { | ||||
|       expect(getGodotUrl('4.0.0-beta.16', getPlatform('linux'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta.16', getPlatform('linux'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_linux_x86_64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta.16', getPlatform('win32'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta.16', getPlatform('win32'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_win64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta.16', getPlatform('darwin'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta.16', getPlatform('darwin'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_macos.universal.zip' | ||||
|       ) | ||||
|     }) | ||||
|     test('4.0.0-beta8', () => { | ||||
|       expect(getGodotUrl('4.0.0-beta8', getPlatform('linux'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta8', getPlatform('linux'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_linux_x86_64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta8', getPlatform('win32'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta8', getPlatform('win32'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_win64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta8', getPlatform('darwin'), true, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta8', getPlatform('darwin'), true, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta8/mono/Godot_v4.0-beta8_mono_macos.universal.zip' | ||||
|       ) | ||||
|     }) | ||||
| @ -90,24 +115,36 @@ describe('getGodotUrl', () => { | ||||
| 
 | ||||
|   describe('useDotnet = false', () => { | ||||
|     test('4.0.0-beta1', () => { | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('linux'), false, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('linux'), false, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_linux.x86_64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('win32'), false, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('win32'), false, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_win64.exe.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_macos.universal.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, true)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta1', getPlatform('darwin'), false, true) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_export_templates.tpz' | ||||
|       ) | ||||
|     }) | ||||
|     test('4.0.0-beta.16', () => { | ||||
|       expect(getGodotUrl('4.0.0-beta.16', getPlatform('linux'), false, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta.16', getPlatform('linux'), false, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_linux.x86_64.zip' | ||||
|       ) | ||||
|       expect(getGodotUrl('4.0.0-beta.16', getPlatform('win32'), false, false)).toEqual( | ||||
|       expect( | ||||
|         getGodotUrl('4.0.0-beta.16', getPlatform('win32'), false, false) | ||||
|       ).toEqual( | ||||
|         'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_win64.exe.zip' | ||||
|       ) | ||||
|       expect( | ||||
| @ -132,94 +169,226 @@ describe('getGodotUrl', () => { | ||||
| describe('getExportTemplatePath', () => { | ||||
|   describe('useDotnet = true', () => { | ||||
|     test('4.0.0-beta1', () => { | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), true)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.beta1.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/export_templates', | ||||
|           '4.0.beta1.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('win32'), true)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/export_templates', '4.0.beta1.mono') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('darwin'), true)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.beta1.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('win32'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/export_templates', | ||||
|           '4.0.beta1.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('darwin'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/export_templates', | ||||
|           '4.0.beta1.mono' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('4.0.0', () => { | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('linux'), true)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('linux'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/export_templates', | ||||
|           '4.0.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('win32'), true)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/export_templates', '4.0.stable.mono') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('darwin'), true)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('win32'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/export_templates', | ||||
|           '4.0.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('darwin'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/export_templates', | ||||
|           '4.0.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('3.5.1', () => { | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('linux'), true)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/templates', '3.5.1.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('linux'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/templates', | ||||
|           '3.5.1.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('win32'), true)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.1.stable.mono') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('darwin'), true)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.1.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('win32'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/templates', | ||||
|           '3.5.1.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('darwin'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/templates', | ||||
|           '3.5.1.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('3.5.0', () => { | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('linux'), true)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/templates', '3.5.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('linux'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/templates', | ||||
|           '3.5.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('win32'), true)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.stable.mono') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('darwin'), true)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.stable.mono') | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('win32'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/templates', | ||||
|           '3.5.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('darwin'), true) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/templates', | ||||
|           '3.5.stable.mono' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|   }) | ||||
| 
 | ||||
|   describe('useDotnet = false', () => { | ||||
|     test('4.0.0-beta1', () => { | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), false)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.beta1') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/export_templates', | ||||
|           '4.0.beta1' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('win32'), false)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/export_templates', '4.0.beta1') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('4.0.0-beta1', getPlatform('darwin'), false)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.beta1') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('win32'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/export_templates', | ||||
|           '4.0.beta1' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0-beta1', getPlatform('darwin'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/export_templates', | ||||
|           '4.0.beta1' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('4.0.0', () => { | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('linux'), false)).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.stable') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('linux'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '.local/share/godot/export_templates', | ||||
|           '4.0.stable' | ||||
|         ) | ||||
|       ) | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('win32'), false)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/export_templates', '4.0.stable') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('4.0.0', getPlatform('darwin'), false)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.stable') | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('win32'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/export_templates', | ||||
|           '4.0.stable' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('4.0.0', getPlatform('darwin'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/export_templates', | ||||
|           '4.0.stable' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('3.5.1', () => { | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('linux'), false)).toEqual( | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('linux'), false) | ||||
|       ).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/templates', '3.5.1.stable') | ||||
|       ) | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('win32'), false)).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.1.stable') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('3.5.1', getPlatform('darwin'), false)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.1.stable') | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('win32'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           'AppData/Roaming/Godot/templates', | ||||
|           '3.5.1.stable' | ||||
|         ) | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.1', getPlatform('darwin'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/templates', | ||||
|           '3.5.1.stable' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|     test('3.5.0', () => { | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('linux'), false)).toEqual( | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('linux'), false) | ||||
|       ).toEqual( | ||||
|         path.join(os.homedir(), '.local/share/godot/templates', '3.5.stable') | ||||
|       ) | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('win32'), false)).toEqual( | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('win32'), false) | ||||
|       ).toEqual( | ||||
|         path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.stable') | ||||
|               ) | ||||
|       expect(getExportTemplatePath('3.5.0', getPlatform('darwin'), false)).toEqual( | ||||
|         path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.stable') | ||||
|       ) | ||||
|       expect( | ||||
|         getExportTemplatePath('3.5.0', getPlatform('darwin'), false) | ||||
|       ).toEqual( | ||||
|         path.join( | ||||
|           os.homedir(), | ||||
|           '/Library/Application Support/Godot/templates', | ||||
|           '3.5.stable' | ||||
|         ) | ||||
|       ) | ||||
|     }) | ||||
|   }) | ||||
|  | ||||
							
								
								
									
										49
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										49
									
								
								dist/index.js
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -258,8 +258,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); | ||||
| exports.findExecutablesRecursively = exports.getPlatform = exports.getGodotFilenameFromVersionString = exports.getGodotFilenameBase = exports.getGodotFilename = exports.getExportTemplatePath = exports.getGodotUrl = exports.parseVersion = exports.MacOS = exports.Windows = exports.Linux = void 0; | ||||
| const core = __importStar(__nccwpck_require__(2186)); | ||||
| const fs = __importStar(__nccwpck_require__(7147)); | ||||
| const path_1 = __importDefault(__nccwpck_require__(1017)); | ||||
| const normalize_path_1 = __importDefault(__nccwpck_require__(5388)); | ||||
| const os_1 = __importDefault(__nccwpck_require__(2037)); | ||||
| const path_1 = __importDefault(__nccwpck_require__(1017)); | ||||
| class Linux { | ||||
|     constructor() { | ||||
|         this.GODOT_EXPORT_TEMPLATE_BASE_PATH = path_1.default.join(os_1.default.homedir(), '.local/share/godot'); | ||||
| @ -280,7 +281,7 @@ class Linux { | ||||
| exports.Linux = Linux; | ||||
| class Windows { | ||||
|     constructor() { | ||||
|         this.GODOT_EXPORT_TEMPLATE_BASE_PATH = path_1.default.join(os_1.default.homedir(), '\\AppData\\Roaming\\Godot'); | ||||
|         this.GODOT_EXPORT_TEMPLATE_BASE_PATH = path_1.default.normalize(path_1.default.join(os_1.default.homedir(), '\\AppData\\Roaming\\Godot')); | ||||
|     } | ||||
|     godotFilenameSuffix(useDotnet) { | ||||
|         if (useDotnet) { | ||||
| @ -386,7 +387,7 @@ function getExportTemplatePath(versionString, platform, useDotnet) { | ||||
|     } | ||||
|     if (useDotnet) | ||||
|         folderName += '.mono'; | ||||
|     return path_1.default.join(platform.GODOT_EXPORT_TEMPLATE_BASE_PATH, version.major === '4' ? 'export_templates' : 'templates', folderName); | ||||
|     return (0, normalize_path_1.default)(path_1.default.join(platform.GODOT_EXPORT_TEMPLATE_BASE_PATH, version.major === '4' ? 'export_templates' : 'templates', folderName)); | ||||
| } | ||||
| exports.getExportTemplatePath = getExportTemplatePath; | ||||
| function getGodotFilename(version, platform, useDotnet) { | ||||
| @ -51367,6 +51368,48 @@ exports.Response = Response; | ||||
| exports.FetchError = FetchError; | ||||
| 
 | ||||
| 
 | ||||
| /***/ }), | ||||
| 
 | ||||
| /***/ 5388: | ||||
| /***/ ((module) => { | ||||
| 
 | ||||
| /*! | ||||
|  * normalize-path <https://github.com/jonschlinkert/normalize-path>
 | ||||
|  * | ||||
|  * Copyright (c) 2014-2018, Jon Schlinkert. | ||||
|  * Released under the MIT License. | ||||
|  */ | ||||
| 
 | ||||
| module.exports = function(path, stripTrailing) { | ||||
|   if (typeof path !== 'string') { | ||||
|     throw new TypeError('expected path to be a string'); | ||||
|   } | ||||
| 
 | ||||
|   if (path === '\\' || path === '/') return '/'; | ||||
| 
 | ||||
|   var len = path.length; | ||||
|   if (len <= 1) return path; | ||||
| 
 | ||||
|   // ensure that win32 namespaces has two leading slashes, so that the path is
 | ||||
|   // handled properly by the win32 version of path.parse() after being normalized
 | ||||
|   // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
 | ||||
|   var prefix = ''; | ||||
|   if (len > 4 && path[3] === '\\') { | ||||
|     var ch = path[2]; | ||||
|     if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { | ||||
|       path = path.slice(2); | ||||
|       prefix = '//'; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   var segs = path.split(/[/\\]+/); | ||||
|   if (stripTrailing !== false && segs[segs.length - 1] === '') { | ||||
|     segs.pop(); | ||||
|   } | ||||
|   return prefix + segs.join('/'); | ||||
| }; | ||||
| 
 | ||||
| 
 | ||||
| /***/ }), | ||||
| 
 | ||||
| /***/ 9975: | ||||
|  | ||||
							
								
								
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js.map
									
									
									
										generated
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										25
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								dist/licenses.txt
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -800,6 +800,31 @@ SOFTWARE. | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| normalize-path | ||||
| MIT | ||||
| The MIT License (MIT) | ||||
| 
 | ||||
| Copyright (c) 2014-2018, Jon Schlinkert. | ||||
| 
 | ||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
| of this software and associated documentation files (the "Software"), to deal | ||||
| in the Software without restriction, including without limitation the rights | ||||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
| copies of the Software, and to permit persons to whom the Software is | ||||
| furnished to do so, subject to the following conditions: | ||||
| 
 | ||||
| The above copyright notice and this permission notice shall be included in | ||||
| all copies or substantial portions of the Software. | ||||
| 
 | ||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||||
| THE SOFTWARE. | ||||
| 
 | ||||
| 
 | ||||
| psl | ||||
| MIT | ||||
| The MIT License (MIT) | ||||
|  | ||||
							
								
								
									
										18
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										18
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -11,7 +11,9 @@ | ||||
|       "dependencies": { | ||||
|         "@actions/cache": "^3.1.2", | ||||
|         "@actions/core": "^1.10.0", | ||||
|         "@actions/tool-cache": "^2.0.1" | ||||
|         "@actions/tool-cache": "^2.0.1", | ||||
|         "@types/normalize-path": "^3.0.0", | ||||
|         "normalize-path": "^3.0.0" | ||||
|       }, | ||||
|       "devDependencies": { | ||||
|         "@types/node": "^18.14.2", | ||||
| @ -1565,6 +1567,11 @@ | ||||
|         "node": ">= 6" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@types/normalize-path": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@types/normalize-path/-/normalize-path-3.0.0.tgz", | ||||
|       "integrity": "sha512-Nd8y/5t/7CRakPYiyPzr/IAfYusy1FkcZYFEAcoMZkwpJv2n4Wm+olW+e7xBdHEXhOnWdG9ddbar0gqZWS4x5Q==" | ||||
|     }, | ||||
|     "node_modules/@types/prettier": { | ||||
|       "version": "2.7.2", | ||||
|       "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", | ||||
| @ -5437,7 +5444,6 @@ | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||
|       "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", | ||||
|       "dev": true, | ||||
|       "engines": { | ||||
|         "node": ">=0.10.0" | ||||
|       } | ||||
| @ -8119,6 +8125,11 @@ | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "@types/normalize-path": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@types/normalize-path/-/normalize-path-3.0.0.tgz", | ||||
|       "integrity": "sha512-Nd8y/5t/7CRakPYiyPzr/IAfYusy1FkcZYFEAcoMZkwpJv2n4Wm+olW+e7xBdHEXhOnWdG9ddbar0gqZWS4x5Q==" | ||||
|     }, | ||||
|     "@types/prettier": { | ||||
|       "version": "2.7.2", | ||||
|       "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", | ||||
| @ -10947,8 +10958,7 @@ | ||||
|     "normalize-path": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", | ||||
|       "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", | ||||
|       "dev": true | ||||
|       "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" | ||||
|     }, | ||||
|     "npm-run-path": { | ||||
|       "version": "4.0.1", | ||||
|  | ||||
| @ -29,7 +29,9 @@ | ||||
|   "dependencies": { | ||||
|     "@actions/cache": "^3.1.2", | ||||
|     "@actions/core": "^1.10.0", | ||||
|     "@actions/tool-cache": "^2.0.1" | ||||
|     "@actions/tool-cache": "^2.0.1", | ||||
|     "@types/normalize-path": "^3.0.0", | ||||
|     "normalize-path": "^3.0.0" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@types/node": "^18.14.2", | ||||
|  | ||||
							
								
								
									
										18
									
								
								src/utils.ts
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								src/utils.ts
									
									
									
									
									
								
							| @ -1,7 +1,8 @@ | ||||
| import * as core from '@actions/core' | ||||
| import * as fs from 'fs' | ||||
| import path from 'path' | ||||
| import normalize from 'normalize-path' | ||||
| import os from 'os' | ||||
| import path from 'path' | ||||
| 
 | ||||
| export interface Platform { | ||||
|   /** Godot installation filename suffix. */ | ||||
| @ -51,9 +52,8 @@ export class Linux implements Platform { | ||||
| } | ||||
| 
 | ||||
| export class Windows implements Platform { | ||||
|   GODOT_EXPORT_TEMPLATE_BASE_PATH = path.join( | ||||
|     os.homedir(), | ||||
|     '\\AppData\\Roaming\\Godot' | ||||
|   GODOT_EXPORT_TEMPLATE_BASE_PATH = path.normalize( | ||||
|     path.join(os.homedir(), '\\AppData\\Roaming\\Godot') | ||||
|   ) | ||||
| 
 | ||||
|   godotFilenameSuffix(useDotnet: boolean): string { | ||||
| @ -200,10 +200,12 @@ export function getExportTemplatePath( | ||||
|   } | ||||
|   if (useDotnet) folderName += '.mono' | ||||
| 
 | ||||
|   return path.join( | ||||
|     platform.GODOT_EXPORT_TEMPLATE_BASE_PATH, | ||||
|     version.major === '4' ? 'export_templates' : 'templates', | ||||
|     folderName | ||||
|   return normalize( | ||||
|     path.join( | ||||
|       platform.GODOT_EXPORT_TEMPLATE_BASE_PATH, | ||||
|       version.major === '4' ? 'export_templates' : 'templates', | ||||
|       folderName | ||||
|     ) | ||||
|   ) | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user