Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/fixes #42

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/supervisord/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ autostart=true

[program:delve]
user=root
command=/bin/bash -c 'pid=""; while [ -z "$pid" ]; do pid=$(pgrep gpx_factry); done; /root/go/bin/dlv attach --api-version=2 --headless --continue --accept-multiclient --listen=:2345 $pid'
command=/bin/bash -c 'pid=""; while [ -z "$pid" ]; do pid=$(pgrep gpx_factry); done; /root/go/bin/dlv attach --api-version=2 --headless --accept-multiclient --listen=:2345 $pid'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
Expand Down
22 changes: 10 additions & 12 deletions src/QueryEditor/util.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you also need to update the backend semver compare function

Original file line number Diff line number Diff line change
Expand Up @@ -351,16 +351,12 @@ export function semverCompare(a: string, b: string): number {
if (b.startsWith('v')) {
b = b.substring(1)
}
const aParts = a.split('.')
const bParts = b.split('.')
const aParts = a.split(/[-.]/)
const bParts = b.split(/[-.]/)

for (let i = 0; i < aParts.length; i++) {
if (i >= bParts.length) {
return 1
}

const aPart = parseInt(aParts[i], 10)
const bPart = parseInt(bParts[i], 10)
for (let i = 0; i < Math.min(aParts.length, bParts.length); i++) {
const aPart = parseInt(aParts[i] || '0', 10)
const bPart = parseInt(bParts[i] || '0', 10)

if (aPart < bPart) {
return -1
Expand All @@ -369,11 +365,13 @@ export function semverCompare(a: string, b: string): number {
if (aPart > bPart) {
return 1
}

if (aParts[i] !== bParts[i]) {
return aParts[i] > bParts[i] ? 1 : -1
}
}

if (aParts.length < bParts.length) {
return -1
} else if (aParts.length > bParts.length) {
if (aParts.length > bParts.length) {
return 1
}

Expand Down
Loading