Skip to content

Commit

Permalink
Add log about using local ameba
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Nov 17, 2024
1 parent b512e03 commit c6a137b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from 'path';
import { existsSync } from 'fs';
import semver = require('semver');
import { execSync } from 'child_process';
import { outputChannel } from './extension';

export interface AmebaConfig {
command: string;
Expand All @@ -16,7 +17,12 @@ export function getConfig(): AmebaConfig {
const root = workspace.workspaceFolders || [];
if (root.length) {
const localAmebaPath = path.join(root[0].uri.fsPath, 'bin', 'ameba');
if (existsSync(localAmebaPath)) command = localAmebaPath;
if (existsSync(localAmebaPath)) {
outputChannel.appendLine(`[Config] Using local ameba at ${localAmebaPath}`)
command = localAmebaPath;
} else {
outputChannel.appendLine(`[Config] Using system ameba`)
}
}

const workspaceConfig = workspace.getConfiguration('crystal-ameba');
Expand Down

0 comments on commit c6a137b

Please sign in to comment.