Skip to content

Commit 25b1b6d

Browse files
is it the bin?
1 parent d0c2293 commit 25b1b6d

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

dist/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28297,9 +28297,9 @@ function getDownloadUrl(version) {
2829728297
return `https://github.com/supabase-community/postgres_lsp/releases/download/${version}/${filename}`;
2829828298
}
2829928299
}
28300-
function determineInstalledVersion() {
28300+
function determineInstalledVersion(binName) {
2830128301
return __awaiter(this, void 0, void 0, function* () {
28302-
const { stdout } = yield doExec('pglt --version');
28302+
const { stdout } = yield doExec(`${binName} --version`);
2830328303
const version = stdout.trim();
2830428304
if (!version) {
2830528305
throw new Error('Could not determine installed PGLT version');
@@ -28332,7 +28332,9 @@ function main() {
2833228332
yield (0, promises_1.symlink)(tool, symlinkPath);
2833328333
core.info(`Adding to path: ${symlinkPath}`);
2833428334
core.addPath(symlinkPath);
28335-
const installedVersion = yield determineInstalledVersion();
28335+
const withOgName = yield determineInstalledVersion(tool);
28336+
core.info(`Can determine with og name: ${withOgName}`);
28337+
const installedVersion = yield determineInstalledVersion('pglt');
2833628338
core.setOutput('installed-version', installedVersion);
2833728339
}
2833828340
catch (err) {

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ function getDownloadUrl(version: string): string {
6565
}
6666
}
6767

68-
async function determineInstalledVersion(): Promise<string> {
69-
const { stdout } = await doExec('pglt --version')
68+
async function determineInstalledVersion(binName: string): Promise<string> {
69+
const { stdout } = await doExec(`${binName} --version`)
7070

7171
const version = stdout.trim()
7272
if (!version) {
@@ -108,7 +108,10 @@ async function main() {
108108
core.info(`Adding to path: ${symlinkPath}`)
109109
core.addPath(symlinkPath)
110110

111-
const installedVersion = await determineInstalledVersion()
111+
const withOgName = await determineInstalledVersion(tool)
112+
core.info(`Can determine with og name: ${withOgName}`)
113+
114+
const installedVersion = await determineInstalledVersion('pglt')
112115
core.setOutput('installed-version', installedVersion)
113116
} catch (err) {
114117
if (err instanceof Error) {

0 commit comments

Comments
 (0)