mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-03-27 09:45:53 +00:00
Replace shell commands that fail on Windows with Node.js scripts: - mkdir -p / cp -r → scripts/copy-assets.js - rm -rf → scripts/clean.js - Add scripts/ensure-dirs.js for directory creation This resolves "A subdirectory or file -p already exists" errors when running npm scripts on Windows with Git Bash. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
20 lines
No EOL
554 B
JavaScript
20 lines
No EOL
554 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Ensure public directory exists
|
|
fs.mkdirSync('public', { recursive: true });
|
|
|
|
// Copy assets
|
|
const srcDir = 'src/client/assets';
|
|
const destDir = 'public';
|
|
|
|
if (fs.existsSync(srcDir)) {
|
|
fs.readdirSync(srcDir).forEach(file => {
|
|
const srcPath = path.join(srcDir, file);
|
|
const destPath = path.join(destDir, file);
|
|
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
});
|
|
console.log('Assets copied successfully');
|
|
} else {
|
|
console.log('No assets directory found, skipping copy');
|
|
} |