gemini-cli-pro 0.0.4-snapshot → 0.0.6-snapshot
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/gemini +19 -1
- package/package.json +1 -1
package/bin/gemini
CHANGED
|
@@ -11,6 +11,18 @@ done
|
|
|
11
11
|
SCRIPT_DIR="$(cd -P "$(dirname "${SOURCE}")" && pwd)"
|
|
12
12
|
PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
13
13
|
PYTHON_BIN="${PYTHON_BIN:-python3}"
|
|
14
|
+
TOOL_PATH="${PROJECT_DIR}/gemini_tool.py"
|
|
15
|
+
|
|
16
|
+
if [ ! -f "${TOOL_PATH}" ] && command -v npm >/dev/null 2>&1; then
|
|
17
|
+
NPM_ROOT="$(npm root -g 2>/dev/null || true)"
|
|
18
|
+
for PKG_NAME in "gemini-cli-pro" "gemini-cli" "@jocsapb/gemini-cli"; do
|
|
19
|
+
CANDIDATE="${NPM_ROOT}/${PKG_NAME}/gemini_tool.py"
|
|
20
|
+
if [ -f "${CANDIDATE}" ]; then
|
|
21
|
+
TOOL_PATH="${CANDIDATE}"
|
|
22
|
+
break
|
|
23
|
+
fi
|
|
24
|
+
done
|
|
25
|
+
fi
|
|
14
26
|
|
|
15
27
|
if ! command -v "${PYTHON_BIN}" >/dev/null 2>&1; then
|
|
16
28
|
echo "Erro: python3 nao encontrado no PATH." >&2
|
|
@@ -23,4 +35,10 @@ if ! "${PYTHON_BIN}" -c "import google.generativeai" >/dev/null 2>&1; then
|
|
|
23
35
|
exit 1
|
|
24
36
|
fi
|
|
25
37
|
|
|
26
|
-
|
|
38
|
+
if [ ! -f "${TOOL_PATH}" ]; then
|
|
39
|
+
echo "Erro: gemini_tool.py nao encontrado (procurei em ${TOOL_PATH})." >&2
|
|
40
|
+
echo "Reinstale com: npm install -g ." >&2
|
|
41
|
+
exit 1
|
|
42
|
+
fi
|
|
43
|
+
|
|
44
|
+
exec "${PYTHON_BIN}" "${TOOL_PATH}" "$@"
|