Skip to content

Commit

Permalink
v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ahqsoftwares committed May 28, 2024
1 parent af04e8b commit 12c4afc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 64 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
permissions:
contents: write
id-token: write
'on':
on:
push:
branches:
- main
Expand All @@ -19,6 +19,7 @@ permissions:
- .editorconfig
- docs/**
pull_request: null

jobs:
build:
strategy:
Expand Down
67 changes: 5 additions & 62 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,36 +151,12 @@ switch (platform) {
}
break
case 'freebsd':
if (arch !== 'x64') {
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
}
localFileExisted = existsSync(join(__dirname, 'cli.freebsd-x64.node'))
try {
if (localFileExisted) {
nativeBinding = require('./cli.freebsd-x64.node')
} else {
nativeBinding = require('@ahqstore/cli-freebsd-x64')
}
} catch (e) {
loadError = e
}
break
throw new Error("Unsupported OS: FreeBSD");
case 'linux':
switch (arch) {
case 'x64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-x64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./cli.linux-x64-musl.node')
} else {
nativeBinding = require('@ahqstore/cli-linux-x64-musl')
}
} catch (e) {
loadError = e
}
throw new Error("MUSL Bindings are not supported!");
} else {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-x64-gnu.node')
Expand All @@ -198,18 +174,7 @@ switch (platform) {
break
case 'arm64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-arm64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./cli.linux-arm64-musl.node')
} else {
nativeBinding = require('@ahqstore/cli-linux-arm64-musl')
}
} catch (e) {
loadError = e
}
throw new Error("MUSL Bindings are not supported!");
} else {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-arm64-gnu.node')
Expand All @@ -227,18 +192,7 @@ switch (platform) {
break
case 'arm':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-arm-musleabihf.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./cli.linux-arm-musleabihf.node')
} else {
nativeBinding = require('@ahqstore/cli-linux-arm-musleabihf')
}
} catch (e) {
loadError = e
}
throw new Error("MUSL Bindings are not supported!");
} else {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-arm-gnueabihf.node')
Expand All @@ -256,18 +210,7 @@ switch (platform) {
break
case 'riscv64':
if (isMusl()) {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-riscv64-musl.node')
)
try {
if (localFileExisted) {
nativeBinding = require('./cli.linux-riscv64-musl.node')
} else {
nativeBinding = require('@ahqstore/cli-linux-riscv64-musl')
}
} catch (e) {
loadError = e
}
throw new Error("MUSL Bindings are not supported!");
} else {
localFileExisted = existsSync(
join(__dirname, 'cli.linux-riscv64-gnu.node')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ahqstore/cli",
"version": "0.0.0",
"version": "0.3.0",
"napi": {
"name": "cli",
"triples": {
Expand Down

0 comments on commit 12c4afc

Please sign in to comment.