comment on major version

This commit is contained in:
2021-04-15 01:08:56 +02:00
parent 190eca6f6e
commit 7629626ae0
3 changed files with 30 additions and 4 deletions

View File

@@ -22,9 +22,9 @@ export async function upgrade() {
const latest = semver.coerce(json.tag_name)
const current = semver.coerce(VERSION)
if (!latest || !current) throw new Error('Could not parse versions numbers.')
if (semver.gt(latest, current) && semver.major(latest) === semver.major(current)) {
// Update to compatible
if (json.tag_name != VERSION) {
if (semver.gt(latest, current)) {
if (semver.major(latest) === semver.major(current)) {
// Update to compatible
const platformMap: { [key: string]: string } = {
darwin: 'macos',
}
@@ -37,6 +37,8 @@ export async function upgrade() {
await downloadFile(dl.browser_download_url, to)
chmodSync(to, 0o755)
} else {
w.appendLn('Newer major version available, will not install automatically.')
}
}

View File

@@ -17,7 +17,7 @@ import install from './handlers/install'
import { uninstall } from './handlers/uninstall'
import { upgrade } from './handlers/upgrade'
export const VERSION = '0.28'
export const VERSION = '0.29'
export const INSTALL_DIR = '/usr/local/bin'
let requireConfig: boolean = true