Improve build system and clean up project structure
- Configure build script to create backups in backup/ directory - Add backup/ directory to .gitignore to keep repo clean - Add .gitignore file with common exclusions - Remove obsolete dog-food-calculator-widget.js file - Move all temporary and reference files to sundog-calculator-meta/ This keeps the project root clean and organized while maintaining automatic backups during builds.
This commit is contained in:
parent
73793f43a1
commit
c7a4aa01ba
27
.gitignore
vendored
Normal file
27
.gitignore
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
|
||||||
|
# Personal files
|
||||||
|
theme.scss
|
||||||
|
_variables.scss
|
||||||
|
reference.png
|
||||||
|
better.png
|
||||||
|
START_PROMPT.md
|
||||||
|
CLAUDE.md
|
||||||
|
CLAUDE_V2.md
|
||||||
|
math.md
|
||||||
|
vetcalculators/
|
||||||
|
*.js.backup*
|
||||||
|
backup/
|
||||||
11
build.js
11
build.js
@ -77,14 +77,21 @@ function readSourceComponents() {
|
|||||||
* Backup existing files
|
* Backup existing files
|
||||||
*/
|
*/
|
||||||
function backupFiles() {
|
function backupFiles() {
|
||||||
|
const backupDir = 'backup';
|
||||||
|
|
||||||
|
// Create backup directory if it doesn't exist
|
||||||
|
if (!fs.existsSync(backupDir)) {
|
||||||
|
fs.mkdirSync(backupDir);
|
||||||
|
}
|
||||||
|
|
||||||
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
||||||
const filesToBackup = ['iframe.html', 'sundog-dog-food-calculator.js'];
|
const filesToBackup = ['iframe.html', 'sundog-dog-food-calculator.js'];
|
||||||
|
|
||||||
filesToBackup.forEach(file => {
|
filesToBackup.forEach(file => {
|
||||||
if (fs.existsSync(file)) {
|
if (fs.existsSync(file)) {
|
||||||
const backupName = `${file}.backup-${timestamp}`;
|
const backupName = path.join(backupDir, `${file}.backup-${timestamp}`);
|
||||||
fs.copyFileSync(file, backupName);
|
fs.copyFileSync(file, backupName);
|
||||||
console.log(`📦 Backed up ${file} to: ${backupName}`);
|
console.log(` 📦 Backed up ${file}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user