Skip to content

Commit

Permalink
Fix a Windows bug where trying to install the RPE would fail
Browse files Browse the repository at this point in the history
  • Loading branch information
furudean committed Aug 29, 2024
1 parent 8516796 commit 5fcfb78
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## Unreleased

- Fix a Windows bug where trying to install the RPE would fail

## 1.19.0 - 2024-08-28

- The status bar will now have a button action to "Set Ren'Py SDK Path" if the
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { set_config, set_config_exclusive } from './config'
* Throws an error if the user cancels the prompt.
*/
export async function prompt_configure_extensions(
executable: string
executable: string[]
): Promise<void> {
const selection_map: Record<string, () => Promise<void>> = {
'Always use extensions (recommended)': async () => {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/rpe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function install_rpe({
context,
}: {
sdk_path: string
executable: string
executable: string[]
project_root: string
context: vscode.ExtensionContext
}): Promise<string | undefined> {
Expand Down Expand Up @@ -101,7 +101,7 @@ export async function has_current_rpe({
sdk_path,
context,
}: {
executable: string
executable: string[]
sdk_path: string
context: vscode.ExtensionContext
}): Promise<string | false> {
Expand Down Expand Up @@ -170,7 +170,7 @@ export async function prompt_install_rpe(
if (!executable) return

const current_rpe = await has_current_rpe({
executable: executable.join(' '),
executable,
sdk_path,
context,
})
Expand All @@ -180,7 +180,7 @@ export async function prompt_install_rpe(
return current_rpe
}

const version = get_version(executable.join(' '))
const version = get_version(executable)

if (!semver.satisfies(version.semver, '>=8')) {
await prompt_not_rpy8_invalid_configuration(version.semver)
Expand All @@ -191,7 +191,7 @@ export async function prompt_install_rpe(
sdk_path,
project_root,
context,
executable: executable.join(' '),
executable,
})
if (!installed_path) return

Expand Down
8 changes: 4 additions & 4 deletions src/lib/sh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const IS_WINDOWS = os.platform() === 'win32'
* @param executable_str
* base renpy.sh command
*/
export function get_version(executable_str: string): {
export function get_version(executable: string[]): {
semver: string
major: number
minor: number
Expand All @@ -25,11 +25,11 @@ export function get_version(executable_str: string): {
const RENPY_VERSION_REGEX =
/^Ren'Py (?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?:\.(?<rest>.*))?\s*$/

logger.debug('getting version for', executable_str)
logger.debug('getting version for', executable)

const version_string = child_process.spawnSync(
executable_str,
['--version'],
executable[0],
[...executable.slice(1),'--version'],
{
stdio: 'pipe',
encoding: 'utf-8',
Expand Down

0 comments on commit 5fcfb78

Please sign in to comment.