Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn committed Jan 10, 2024
1 parent c2acda4 commit f88092b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/components/bootstrapExecutablesService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,15 @@ export class BootstrapExecutablesService {
return executableUri;
}

private async __bootstrapCodemodEngineRustExecutableUri(): Promise<Uri> {
private async __bootstrapCodemodEngineRustExecutableUri(): Promise<Uri | null> {
const platform =
process.platform === 'darwin'
? 'macos'
: encodeURIComponent(process.platform);

if(platform === 'win32') {
return null;
}

const executableBaseName = `codemod-engine-rust-${platform}`;

Expand Down
6 changes: 3 additions & 3 deletions src/components/engineService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,11 @@ export class EngineService {
message,
storageUri,
);


const executableCommand = message.command.kind === 'executePiranhaRule'
? this.__getCodemodEngineNodeExecutableCommand()
: this.__getCodemodEngineRustExecutableCommand()

? this.__getCodemodEngineRustExecutableCommand()
: this.__getCodemodEngineNodeExecutableCommand()
const childProcess = spawn(
executableCommand,
args,
Expand Down
2 changes: 1 addition & 1 deletion src/components/messageBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export type Message =
| Readonly<{
kind: MessageKind.engineBootstrapped;
codemodEngineNodeExecutableUri: Uri;
codemodEngineRustExecutableUri: Uri;
codemodEngineRustExecutableUri: Uri | null;
}>
| Readonly<{
kind: MessageKind.executeCodemodSet;
Expand Down

0 comments on commit f88092b

Please sign in to comment.