mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
25 lines
741 B
TypeScript
25 lines
741 B
TypeScript
import fs from 'fs-extra'
|
|
import { execSync } from 'node:child_process'
|
|
import path from 'node:path'
|
|
|
|
const workflowTemplatesRepo = 'https://github.com/Comfy-Org/workflow_templates'
|
|
const tempRepoDir = './templates_repo'
|
|
|
|
// Clone the repository
|
|
execSync(`git clone ${workflowTemplatesRepo} --depth 1 ${tempRepoDir}`)
|
|
|
|
// Create public/templates directory if it doesn't exist
|
|
fs.ensureDirSync('public/templates')
|
|
|
|
// Copy templates from repo to public/templates
|
|
const sourceDir = path.join(tempRepoDir, 'templates')
|
|
const targetDir = 'public/templates'
|
|
|
|
// Copy entire directory at once
|
|
fs.copySync(sourceDir, targetDir)
|
|
|
|
// Remove the temporary repository directory
|
|
fs.removeSync(tempRepoDir)
|
|
|
|
console.log('Templates fetched successfully')
|