Add files via upload

This commit is contained in:
公明
2025-11-21 23:18:21 +08:00
committed by GitHub
parent d3e48eaf44
commit c6fbd12447
30 changed files with 420 additions and 510 deletions

View File

@@ -3,28 +3,28 @@ command: "/bin/bash"
args:
- "-c"
- |
set -euo pipefail
set -euo pipefail
SCRIPT_CONTENT="$1"
ENV_NAME="${2:-default}"
ADDITIONAL_ARGS="${3:-}"
SCRIPT_CONTENT="$1"
ENV_NAME="${2:-default}"
ADDITIONAL_ARGS="${3:-}"
BASE_DIR="${HOME}/.cyberstrike/venvs"
ENV_DIR="${BASE_DIR}/${ENV_NAME}"
BASE_DIR="${HOME}/.cyberstrike/venvs"
ENV_DIR="${BASE_DIR}/${ENV_NAME}"
mkdir -p "$BASE_DIR"
if [ ! -d "$ENV_DIR" ]; then
python3 -m venv "$ENV_DIR"
fi
mkdir -p "$BASE_DIR"
if [ ! -d "$ENV_DIR" ]; then
python3 -m venv "$ENV_DIR"
fi
# shellcheck disable=SC1090
source "$ENV_DIR/bin/activate"
# shellcheck disable=SC1090
source "$ENV_DIR/bin/activate"
if [ -n "$ADDITIONAL_ARGS" ]; then
python3 $ADDITIONAL_ARGS -c "$SCRIPT_CONTENT"
else
python3 -c "$SCRIPT_CONTENT"
fi
if [ -n "$ADDITIONAL_ARGS" ]; then
python3 $ADDITIONAL_ARGS -c "$SCRIPT_CONTENT"
else
python3 -c "$SCRIPT_CONTENT"
fi
- "_"
enabled: true
short_description: "在指定虚拟环境中编写并执行Python脚本"