Files
spark-store/extras/shell-caller.sh
2026-01-30 19:53:46 +08:00

19 lines
463 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 检查是否提供了至少一个参数
if [[ $# -eq 0 ]]; then
echo "错误:未提供命令参数。用法: $0 apm <子命令> [参数...]"
exit 1
fi
# 严格验证第一个参数必须是 "apm"
if [[ "$1" != "apm" ]]; then
echo "拒绝执行:仅允许执行 'apm' 命令。收到的第一个参数: '$1'"
exit 1
fi
# 执行 apm 命令(跳过第一个参数 "apm"
/usr/bin/apm "${@:2}" 2>&1
exit_code=$?
exit $exit_code