save-artifact

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

save-artifact

save-artifact

Save target artifacts to ~/projects/artifacts-viewer for easy viewing and organization.
将目标工件保存到~/projects/artifacts-viewer目录,以便于查看和整理。

Quick Usage

快速使用指南

  1. Ensure target directory exists:
    ~/projects/artifacts-viewer
    (auto-created if missing)
  2. Save artifact: Copy or move the file to artifacts-viewer with appropriate naming
  3. Git operations: Initialize git repo and push to GitHub when needed
  1. 确保目标目录存在
    ~/projects/artifacts-viewer
    (若不存在则自动创建)
  2. 保存工件:将文件复制或移动到artifacts-viewer目录,并使用具有描述性的名称
  3. Git操作:在需要时为artifacts-viewer初始化Git仓库并推送到GitHub

Supported File Types

支持的文件类型

  • Documents:
    .pdf
    ,
    .doc
    ,
    .docx
  • Presentations:
    .ppt
    ,
    .pptx
  • Markdown:
    .md
    ,
    .mdx
  • Images:
    .png
    ,
    .jpg
    ,
    .jpeg
    ,
    .gif
    ,
    .svg
  • Other:
    .txt
    ,
    .json
  • 文档类:
    .pdf
    ,
    .doc
    ,
    .docx
  • 演示文稿类:
    .ppt
    ,
    .pptx
  • Markdown文件:
    .md
    ,
    .mdx
  • 图片类:
    .png
    ,
    .jpg
    ,
    .jpeg
    ,
    .gif
    ,
    .svg
  • 其他类型:
    .txt
    ,
    .json

Workflow

工作流程

Save Artifact

保存工件

bash
undefined
bash
undefined

Ensure directory exists

Ensure directory exists

mkdir -p ~/projects/artifacts-viewer
mkdir -p ~/projects/artifacts-viewer

Copy artifact to viewer (use descriptive name)

Copy artifact to viewer (use descriptive name)

cp <source-file> ~/projects/artifacts-viewer/<descriptive-name>
undefined
cp <source-file> ~/projects/artifacts-viewer/<descriptive-name>
undefined

Git Operations

Git操作

bash
cd ~/projects/artifacts-viewer
git init
git add .
git commit -m "Add artifacts"
git remote add origin https://github.com/<username>/artifacts-viewer.git
git push -u origin main
bash
cd ~/projects/artifacts-viewer
git init
git add .
git commit -m "Add artifacts"
git remote add origin https://github.com/<username>/artifacts-viewer.git
git push -u origin main

Script Usage

脚本使用方法

Use
scripts/save_artifact.py
for automated saving:
bash
python3 scripts/save_artifact.py <source_path> [--name <custom_name>] [--category <category>]
Categories: docs, slides, markdown, images, diagrams, other
使用
scripts/save_artifact.py
进行自动化保存:
bash
python3 scripts/save_artifact.py <source_path> [--name <custom_name>] [--category <category>]
分类选项:docs, slides, markdown, images, diagrams, other

Notes

注意事项

  • Always use descriptive, unique names for artifacts
  • Consider organizing by category subdirectories if needed
  • Commit and push to GitHub for version control and sharing
  • 始终为工件使用描述性的唯一名称
  • 如有需要,可考虑按分类子目录进行整理
  • 提交并推送到GitHub以实现版本控制和共享