baro-ai 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/.gitkeep +0 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +2 -7
- package/bin/baro +0 -25
package/bin/.gitkeep
ADDED
|
File without changes
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -12,8 +12,7 @@ import * as https from "https"
|
|
|
12
12
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
13
13
|
const PACKAGE_ROOT = path.resolve(__dirname, "..")
|
|
14
14
|
const BIN_DIR = path.join(PACKAGE_ROOT, "bin")
|
|
15
|
-
const BINARY_NAME = "baro
|
|
16
|
-
const RELEASE_NAME = "baro"
|
|
15
|
+
const BINARY_NAME = "baro"
|
|
17
16
|
const REPO = "Lotus015/baro"
|
|
18
17
|
|
|
19
18
|
function getPlatformKey() {
|
|
@@ -65,14 +64,10 @@ async function download(url, dest) {
|
|
|
65
64
|
|
|
66
65
|
async function main() {
|
|
67
66
|
const binaryPath = path.join(BIN_DIR, BINARY_NAME)
|
|
68
|
-
if (fs.existsSync(binaryPath)) {
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
67
|
const platformKey = getPlatformKey()
|
|
73
68
|
const version = getVersion()
|
|
74
69
|
|
|
75
|
-
const url = `https://github.com/${REPO}/releases/download/v${version}/${
|
|
70
|
+
const url = `https://github.com/${REPO}/releases/download/v${version}/${BINARY_NAME}-${platformKey}`
|
|
76
71
|
|
|
77
72
|
console.log(`Downloading baro for ${platformKey}...`)
|
|
78
73
|
|
package/bin/baro
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
# Wrapper script that finds and runs the baro native binary.
|
|
3
|
-
# The native binary is downloaded by postinstall.js as baro-native.
|
|
4
|
-
|
|
5
|
-
# Resolve symlinks to find the real script location
|
|
6
|
-
SELF="$0"
|
|
7
|
-
while [ -L "$SELF" ]; do
|
|
8
|
-
DIR="$(cd "$(dirname "$SELF")" && pwd)"
|
|
9
|
-
SELF="$(readlink "$SELF")"
|
|
10
|
-
case "$SELF" in
|
|
11
|
-
/*) ;;
|
|
12
|
-
*) SELF="$DIR/$SELF" ;;
|
|
13
|
-
esac
|
|
14
|
-
done
|
|
15
|
-
SCRIPT_DIR="$(cd "$(dirname "$SELF")" && pwd)"
|
|
16
|
-
|
|
17
|
-
NATIVE="$SCRIPT_DIR/baro-native"
|
|
18
|
-
|
|
19
|
-
if [ ! -f "$NATIVE" ]; then
|
|
20
|
-
echo "Error: baro native binary not found at $NATIVE" >&2
|
|
21
|
-
echo "Try reinstalling: npm install -g baro-ai" >&2
|
|
22
|
-
exit 1
|
|
23
|
-
fi
|
|
24
|
-
|
|
25
|
-
exec "$NATIVE" "$@"
|