跳转至

Scan

Scan 插件

Scan 插件用于扫描指定目录下的文件,将符合条件的文件保存至上下文以供后续步骤使用。

🔗 上下文

上下文 类型 描述 默认值
save_key str 扫描到的文件列表 'default'

⚙ 配置

ScanPluginConfig

ScanPluginConfig

auto_unpack.plugins.scan.ScanPluginConfig

名称 类型 描述 默认值
⭐ name Literal['scan'] 插件名称,固定为 'scan' 'scan'
⭐ dir Path 扫描目录
includes List[str] 包含的文件路径列表,glob 表达式 ['**/*']
excludes List[str] 排除的文件路径列表,glob 表达式 []
include_dir bool 是否包含文件夹 false
上下文字段见上文

♻ 示例

扫描文件夹 archive 下所有 zip 文件

flow:
  steps:
    # 扫描 output 文件夹下所有 zip 文件
    - name: scan
      dir: archive
      includes:
        - "*.zip"

    # 打印扫描到的文件
    - name: log
      file_name: zip_files