fix: improve dependency checks and temp file handling
- Add tar to required dependencies check - Use descriptive mktemp template for easier debugging - Respect TMPDIR environment variable Generated with [Z.ai](https://z.ai/subscribe?ic=JGTYCX7ZO7) Co-Authored-By: Z.ai GLM-5
This commit is contained in:
parent
12ab1988f7
commit
c5edcd55c6
1 changed files with 5 additions and 1 deletions
|
|
@ -73,6 +73,10 @@ check_dependencies() {
|
||||||
missing+=("jq or grep")
|
missing+=("jq or grep")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! command -v tar >/dev/null 2>&1; then
|
||||||
|
missing+=("tar")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ${#missing[@]} -gt 0 ]; then
|
if [ ${#missing[@]} -gt 0 ]; then
|
||||||
msg "$RED" "Error: Missing required dependencies: ${missing[*]}"
|
msg "$RED" "Error: Missing required dependencies: ${missing[*]}"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
@ -438,7 +442,7 @@ install_picoclaw() {
|
||||||
|
|
||||||
# Download binary
|
# Download binary
|
||||||
local tmp_file
|
local tmp_file
|
||||||
tmp_file=$(mktemp)
|
tmp_file=$(mktemp "${TMPDIR:-/tmp}/picoclaw-install.XXXXXX")
|
||||||
local binary_path="${INSTALL_DIR}/${BINARY_NAME}"
|
local binary_path="${INSTALL_DIR}/${BINARY_NAME}"
|
||||||
|
|
||||||
msg "$BLUE" "Downloading ${asset_name}..."
|
msg "$BLUE" "Downloading ${asset_name}..."
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue