Initial commit: Server configurations and license management
This commit is contained in:
97
scripts/init-cad-repo.ps1
Normal file
97
scripts/init-cad-repo.ps1
Normal file
@@ -0,0 +1,97 @@
|
||||
# ===========================================
|
||||
# Initialize CAD Repository Structure
|
||||
# Run this inside your cloned repository
|
||||
# ===========================================
|
||||
|
||||
param(
|
||||
[string]$RepoPath = "."
|
||||
)
|
||||
|
||||
Write-Host "=== Initializing CAD Repository Structure ===" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
Push-Location $RepoPath
|
||||
|
||||
# Create directory structure
|
||||
$directories = @(
|
||||
"NX/Projects/P04-StarSpec"
|
||||
"NX/Projects/Atomaste-Tools"
|
||||
"NX/Projects/Client-Projects"
|
||||
"NX/Templates/part-templates"
|
||||
"NX/Templates/simulation-templates"
|
||||
"NX/Libraries/materials"
|
||||
"NX/Libraries/fasteners"
|
||||
"SolidWorks/Projects"
|
||||
"SolidWorks/Templates"
|
||||
"Exports/STEP"
|
||||
"Exports/STL"
|
||||
"Exports/PDF"
|
||||
"Documentation/specs"
|
||||
"Documentation/reports"
|
||||
)
|
||||
|
||||
foreach ($dir in $directories) {
|
||||
if (!(Test-Path $dir)) {
|
||||
New-Item -ItemType Directory -Path $dir -Force | Out-Null
|
||||
# Create .gitkeep to track empty directories
|
||||
New-Item -ItemType File -Path "$dir/.gitkeep" -Force | Out-Null
|
||||
Write-Host "Created: $dir" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Exists: $dir" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
# Create README.md
|
||||
$readmeContent = @"
|
||||
# CAD Projects Repository
|
||||
|
||||
Version-controlled CAD files using Git LFS on Gitea.
|
||||
|
||||
## Structure
|
||||
|
||||
- **NX/** - NX Siemens projects and files
|
||||
- **Projects/** - Active project folders
|
||||
- **Templates/** - Part and simulation templates
|
||||
- **Libraries/** - Reusable materials and components
|
||||
|
||||
- **SolidWorks/** - SolidWorks projects and files
|
||||
|
||||
- **Exports/** - Exchange format exports (STEP, STL, PDF)
|
||||
|
||||
- **Documentation/** - Specs and reports
|
||||
|
||||
## Quick Commands
|
||||
|
||||
``````bash
|
||||
# Lock a file before editing
|
||||
git lfs lock "NX/Projects/P04-StarSpec/main-assembly.prt"
|
||||
|
||||
# Check what's locked
|
||||
git lfs locks
|
||||
|
||||
# Unlock after committing
|
||||
git lfs unlock "NX/Projects/P04-StarSpec/main-assembly.prt"
|
||||
|
||||
# See LFS tracked files
|
||||
git lfs ls-files
|
||||
``````
|
||||
|
||||
## Server
|
||||
|
||||
- Gitea: http://git.dalidou.home
|
||||
- IP: 192.168.86.50:3000
|
||||
"@
|
||||
|
||||
$readmeContent | Out-File -FilePath "README.md" -Encoding utf8
|
||||
Write-Host "Created: README.md" -ForegroundColor Green
|
||||
|
||||
Pop-Location
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Repository structure initialized!" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
Write-Host "Next steps:" -ForegroundColor Yellow
|
||||
Write-Host " cd $RepoPath"
|
||||
Write-Host " git add ."
|
||||
Write-Host " git commit -m 'Initialize CAD repository structure'"
|
||||
Write-Host " git push"
|
||||
Reference in New Issue
Block a user