agent-browser 0.3.4 → 0.3.6
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/agent-browser
CHANGED
|
@@ -1,28 +1,19 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# agent-browser CLI wrapper
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
SCRIPT="$0"
|
|
5
|
+
while [ -L "$SCRIPT" ]; do
|
|
6
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
|
|
7
|
+
SCRIPT="$(readlink "$SCRIPT")"
|
|
8
|
+
case "$SCRIPT" in /*) ;; *) SCRIPT="$SCRIPT_DIR/$SCRIPT" ;; esac
|
|
9
|
+
done
|
|
10
|
+
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
|
|
4
11
|
|
|
5
12
|
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
|
|
6
13
|
ARCH=$(uname -m)
|
|
14
|
+
case "$OS" in darwin) OS="darwin" ;; linux) OS="linux" ;; mingw*|msys*|cygwin*) OS="win32" ;; esac
|
|
15
|
+
case "$ARCH" in x86_64|amd64) ARCH="x64" ;; aarch64|arm64) ARCH="arm64" ;; esac
|
|
7
16
|
|
|
8
|
-
case "$OS" in
|
|
9
|
-
darwin) OS="darwin" ;;
|
|
10
|
-
linux) OS="linux" ;;
|
|
11
|
-
mingw*|msys*|cygwin*) OS="win32" ;;
|
|
12
|
-
esac
|
|
13
|
-
|
|
14
|
-
case "$ARCH" in
|
|
15
|
-
x86_64|amd64) ARCH="x64" ;;
|
|
16
|
-
aarch64|arm64) ARCH="arm64" ;;
|
|
17
|
-
esac
|
|
18
|
-
|
|
19
|
-
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
20
17
|
BINARY="$SCRIPT_DIR/agent-browser-${OS}-${ARCH}"
|
|
21
|
-
|
|
22
|
-
# Try native binary if it exists
|
|
23
|
-
if [ -f "$BINARY" ] && [ -x "$BINARY" ]; then
|
|
24
|
-
exec "$BINARY" "$@"
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
# Fall back to Node.js
|
|
18
|
+
[ -f "$BINARY" ] && [ -x "$BINARY" ] && exec "$BINARY" "$@"
|
|
28
19
|
exec node "$SCRIPT_DIR/../dist/index.js" "$@"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/agent-browser.cmd
CHANGED
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
@echo off
|
|
2
|
-
:: agent-browser CLI wrapper for Windows
|
|
3
|
-
:: Tries native binary first, falls back to Node.js
|
|
4
|
-
|
|
5
2
|
setlocal
|
|
6
|
-
|
|
7
3
|
set "SCRIPT_DIR=%~dp0"
|
|
8
|
-
|
|
9
|
-
:: Detect architecture
|
|
10
|
-
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
|
|
11
|
-
set "ARCH=x64"
|
|
12
|
-
) else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (
|
|
13
|
-
set "ARCH=arm64"
|
|
14
|
-
) else (
|
|
15
|
-
set "ARCH=x64"
|
|
16
|
-
)
|
|
17
|
-
|
|
4
|
+
if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set "ARCH=x64") else if "%PROCESSOR_ARCHITECTURE%"=="ARM64" (set "ARCH=arm64") else (set "ARCH=x64")
|
|
18
5
|
set "BINARY=%SCRIPT_DIR%agent-browser-win32-%ARCH%.exe"
|
|
19
|
-
|
|
20
|
-
:: Try native binary first
|
|
21
|
-
if exist "%BINARY%" (
|
|
22
|
-
"%BINARY%" %*
|
|
23
|
-
exit /b %errorlevel%
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
:: Fall back to Node.js
|
|
6
|
+
if exist "%BINARY%" ("%BINARY%" %* & exit /b %errorlevel%)
|
|
27
7
|
node "%SCRIPT_DIR%..\dist\index.js" %*
|
|
28
8
|
exit /b %errorlevel%
|