mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-06 20:14:10 +08:00
🍉 Sync 2026-05-16 08:37:13
This commit is contained in:
1 parent
8c1c3dd8ec
commit
8ed4c2a2a5
32 files changed
+1145
-234
No files matched your search
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
. ./root/usr/libexec/openclaw-paths.sh
|
||||
|
||||
fail() {
|
||||
echo "FAIL: $1" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
oc_load_paths "/mnt/data/openclaw"
|
||||
[ "$OPENCLAW_INSTALL_PATH" = "/mnt/data" ] || fail "strip trailing openclaw"
|
||||
[ "$OC_ROOT" = "/mnt/data/openclaw" ] || fail "derive root"
|
||||
|
||||
if oc_normalize_install_path "relative/path" >/dev/null 2>&1; then
|
||||
fail "relative path must be rejected"
|
||||
fi
|
||||
|
||||
if oc_normalize_install_path "/mnt/data bad" >/dev/null 2>&1; then
|
||||
fail "path with whitespace must be rejected"
|
||||
fi
|
||||
|
||||
oc_safe_openclaw_root "/mnt/data/openclaw" || fail "safe root rejected"
|
||||
if oc_safe_openclaw_root "/mnt/data"; then
|
||||
fail "non-openclaw root accepted"
|
||||
fi
|
||||
|
||||
quoted=$(oc_quote "/mnt/a'b/openclaw")
|
||||
[ "$quoted" = "'/mnt/a'\\''b/openclaw'" ] || fail "shell quote"
|
||||
|
||||
echo "ok"
|
||||
Reference in new issue
Block a user