mirror of
https://github.com/chickensoft-games/setup-godot.git
synced 2025-08-15 05:15:07 +00:00
fix: get tests passing on macOS locally by normalizing path
This commit is contained in:
parent
d966ee44cb
commit
c64e41a41c
@ -1,8 +1,13 @@
|
|||||||
import {describe, expect, test} from '@jest/globals'
|
import {describe, expect, test} from '@jest/globals'
|
||||||
import path from 'path'
|
|
||||||
import os from 'os'
|
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', () => {
|
describe('parseVersion', () => {
|
||||||
test('parses valid godot versions', () => {
|
test('parses valid godot versions', () => {
|
||||||
@ -32,38 +37,58 @@ describe('parseVersion', () => {
|
|||||||
describe('getGodotUrl', () => {
|
describe('getGodotUrl', () => {
|
||||||
describe('useDotnet = true', () => {
|
describe('useDotnet = true', () => {
|
||||||
test('4.0.0-beta1', () => {
|
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'
|
'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'
|
'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'
|
'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'
|
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/mono/Godot_v4.0-beta1_mono_export_templates.tpz'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
test('4.0.0-beta.16', () => {
|
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'
|
'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'
|
'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'
|
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/mono/Godot_v4.0-beta16_mono_macos.universal.zip'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
test('4.0.0-beta8', () => {
|
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'
|
'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'
|
'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'
|
'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', () => {
|
describe('useDotnet = false', () => {
|
||||||
test('4.0.0-beta1', () => {
|
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'
|
'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'
|
'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'
|
'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'
|
'https://downloads.tuxfamily.org/godotengine/4.0/beta1/Godot_v4.0-beta1_export_templates.tpz'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
test('4.0.0-beta.16', () => {
|
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'
|
'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'
|
'https://downloads.tuxfamily.org/godotengine/4.0/beta16/Godot_v4.0-beta16_win64.exe.zip'
|
||||||
)
|
)
|
||||||
expect(
|
expect(
|
||||||
@ -132,94 +169,226 @@ describe('getGodotUrl', () => {
|
|||||||
describe('getExportTemplatePath', () => {
|
describe('getExportTemplatePath', () => {
|
||||||
describe('useDotnet = true', () => {
|
describe('useDotnet = true', () => {
|
||||||
test('4.0.0-beta1', () => {
|
test('4.0.0-beta1', () => {
|
||||||
expect(getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), true)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.beta1.mono')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.beta1.mono')
|
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', () => {
|
test('4.0.0', () => {
|
||||||
expect(getExportTemplatePath('4.0.0', getPlatform('linux'), true)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.stable.mono')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.stable.mono')
|
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', () => {
|
test('3.5.1', () => {
|
||||||
expect(getExportTemplatePath('3.5.1', getPlatform('linux'), true)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/templates', '3.5.1.stable.mono')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.1.stable.mono')
|
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', () => {
|
test('3.5.0', () => {
|
||||||
expect(getExportTemplatePath('3.5.0', getPlatform('linux'), true)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/templates', '3.5.stable.mono')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.stable.mono')
|
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', () => {
|
describe('useDotnet = false', () => {
|
||||||
test('4.0.0-beta1', () => {
|
test('4.0.0-beta1', () => {
|
||||||
expect(getExportTemplatePath('4.0.0-beta1', getPlatform('linux'), false)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.beta1')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.beta1')
|
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', () => {
|
test('4.0.0', () => {
|
||||||
expect(getExportTemplatePath('4.0.0', getPlatform('linux'), false)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '.local/share/godot/export_templates', '4.0.stable')
|
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(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/export_templates', '4.0.stable')
|
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', () => {
|
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')
|
path.join(os.homedir(), '.local/share/godot/templates', '3.5.1.stable')
|
||||||
)
|
)
|
||||||
expect(getExportTemplatePath('3.5.1', getPlatform('win32'), false)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.1.stable')
|
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('darwin'), false)).toEqual(
|
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.1.stable')
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
test('3.5.0', () => {
|
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')
|
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')
|
path.join(os.homedir(), 'AppData/Roaming/Godot/templates', '3.5.stable')
|
||||||
)
|
)
|
||||||
expect(getExportTemplatePath('3.5.0', getPlatform('darwin'), false)).toEqual(
|
expect(
|
||||||
path.join(os.homedir(), '/Library/Application Support/Godot/templates', '3.5.stable')
|
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;
|
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 core = __importStar(__nccwpck_require__(2186));
|
||||||
const fs = __importStar(__nccwpck_require__(7147));
|
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 os_1 = __importDefault(__nccwpck_require__(2037));
|
||||||
|
const path_1 = __importDefault(__nccwpck_require__(1017));
|
||||||
class Linux {
|
class Linux {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.GODOT_EXPORT_TEMPLATE_BASE_PATH = path_1.default.join(os_1.default.homedir(), '.local/share/godot');
|
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;
|
exports.Linux = Linux;
|
||||||
class Windows {
|
class Windows {
|
||||||
constructor() {
|
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) {
|
godotFilenameSuffix(useDotnet) {
|
||||||
if (useDotnet) {
|
if (useDotnet) {
|
||||||
@ -386,7 +387,7 @@ function getExportTemplatePath(versionString, platform, useDotnet) {
|
|||||||
}
|
}
|
||||||
if (useDotnet)
|
if (useDotnet)
|
||||||
folderName += '.mono';
|
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;
|
exports.getExportTemplatePath = getExportTemplatePath;
|
||||||
function getGodotFilename(version, platform, useDotnet) {
|
function getGodotFilename(version, platform, useDotnet) {
|
||||||
@ -51367,6 +51368,48 @@ exports.Response = Response;
|
|||||||
exports.FetchError = FetchError;
|
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:
|
/***/ 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
|
psl
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
18
package-lock.json
generated
18
package-lock.json
generated
@ -11,7 +11,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.1.2",
|
"@actions/cache": "^3.1.2",
|
||||||
"@actions/core": "^1.10.0",
|
"@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": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.14.2",
|
"@types/node": "^18.14.2",
|
||||||
@ -1565,6 +1567,11 @@
|
|||||||
"node": ">= 6"
|
"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": {
|
"node_modules/@types/prettier": {
|
||||||
"version": "2.7.2",
|
"version": "2.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz",
|
||||||
@ -5437,7 +5444,6 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"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": {
|
"@types/prettier": {
|
||||||
"version": "2.7.2",
|
"version": "2.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz",
|
||||||
@ -10947,8 +10958,7 @@
|
|||||||
"normalize-path": {
|
"normalize-path": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
|
||||||
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
|
"integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"npm-run-path": {
|
"npm-run-path": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
|
@ -29,7 +29,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.1.2",
|
"@actions/cache": "^3.1.2",
|
||||||
"@actions/core": "^1.10.0",
|
"@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": {
|
"devDependencies": {
|
||||||
"@types/node": "^18.14.2",
|
"@types/node": "^18.14.2",
|
||||||
|
12
src/utils.ts
12
src/utils.ts
@ -1,7 +1,8 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import path from 'path'
|
import normalize from 'normalize-path'
|
||||||
import os from 'os'
|
import os from 'os'
|
||||||
|
import path from 'path'
|
||||||
|
|
||||||
export interface Platform {
|
export interface Platform {
|
||||||
/** Godot installation filename suffix. */
|
/** Godot installation filename suffix. */
|
||||||
@ -51,9 +52,8 @@ export class Linux implements Platform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class Windows implements Platform {
|
export class Windows implements Platform {
|
||||||
GODOT_EXPORT_TEMPLATE_BASE_PATH = path.join(
|
GODOT_EXPORT_TEMPLATE_BASE_PATH = path.normalize(
|
||||||
os.homedir(),
|
path.join(os.homedir(), '\\AppData\\Roaming\\Godot')
|
||||||
'\\AppData\\Roaming\\Godot'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
godotFilenameSuffix(useDotnet: boolean): string {
|
godotFilenameSuffix(useDotnet: boolean): string {
|
||||||
@ -200,11 +200,13 @@ export function getExportTemplatePath(
|
|||||||
}
|
}
|
||||||
if (useDotnet) folderName += '.mono'
|
if (useDotnet) folderName += '.mono'
|
||||||
|
|
||||||
return path.join(
|
return normalize(
|
||||||
|
path.join(
|
||||||
platform.GODOT_EXPORT_TEMPLATE_BASE_PATH,
|
platform.GODOT_EXPORT_TEMPLATE_BASE_PATH,
|
||||||
version.major === '4' ? 'export_templates' : 'templates',
|
version.major === '4' ? 'export_templates' : 'templates',
|
||||||
folderName
|
folderName
|
||||||
)
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGodotFilename(
|
export function getGodotFilename(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user