remove ps1 from copy
This commit is contained in:
@@ -419,6 +419,206 @@ Lines added: 1, lines removed: 1
|
|||||||
|
|
||||||
Perfect! Now `UpgradeSeqBatches.ps1` is properly "Home-ified" with your pathing:
|
Perfect! Now `UpgradeSeqBatches.ps1` is properly "Home-ified" with your pathing:
|
||||||
|
|
||||||
|
✅ **Source files**: Now points to `R:\Creative\artsy\maya\0 ProjectStructure\`
|
||||||
|
✅ **Search path**: Scans `R:\Creative\artsy\maya` recursively for existing `UpdateSequences.bat` files
|
||||||
|
✅ **Consistent with your setup**: Matches the paths used in your other scripts
|
||||||
|
|
||||||
|
The script will now:
|
||||||
|
1. Use your home directory as the source for the latest `UpdateSequences.bat` and `UpdateSequences.ps1`
|
||||||
|
2. Search through your `R:\Creative\artsy\maya` directory structure to find all existing instances
|
||||||
|
3. Update them with the latest versions from your main ProjectStructure folder
|
||||||
|
|
||||||
|
This ensures all your projects across the `maya` directory tree get the latest, properly configured UpdateSequences scripts!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**User**_
|
||||||
|
|
||||||
|
remind me where I should run UpgradeSeqBatches.ps1?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**Assistant**_
|
||||||
|
|
||||||
|
You should run `UpgradeSeqBatches.ps1` from your main ProjectStructure directory:
|
||||||
|
|
||||||
|
**`R:\Creative\artsy\maya\0 ProjectStructure\`**
|
||||||
|
|
||||||
|
This is the ideal location because:
|
||||||
|
|
||||||
|
1. **Source files are local**: The script references `UpdateSequences.bat` and `UpdateSequences.ps1` from the same directory
|
||||||
|
2. **Search path is relative**: It will scan `R:\Creative\artsy\maya` recursively from there
|
||||||
|
3. **Consistent with your setup**: Matches where your other scripts are located
|
||||||
|
|
||||||
|
**To run it:**
|
||||||
|
```powershell
|
||||||
|
cd "R:\Creative\artsy\maya\0 ProjectStructure"
|
||||||
|
.\UpgradeSeqBatches.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
**What it will do:**
|
||||||
|
- Find all existing `UpdateSequences.bat` files across your `maya` directory tree
|
||||||
|
- Copy the latest versions from your main ProjectStructure folder to each location
|
||||||
|
- Update both the `.bat` and `.ps1` files in each project's directory
|
||||||
|
|
||||||
|
This ensures all your projects get the latest, properly configured UpdateSequences scripts with your home pathing and YYYY-MM-DD date format!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**User**_
|
||||||
|
|
||||||
|
it doesn't need to copy the ps1, since the batch points to the ps1 in ProjectStructure anyway.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**Assistant**_
|
||||||
|
|
||||||
|
You're absolutely right! Since the `UpdateSequences.bat` files point to the PS1 in your main ProjectStructure directory, copying the PS1 to each project location is unnecessary and could cause confusion.
|
||||||
|
|
||||||
|
Let me remove that part from the script:
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<details><summary>Edit file: UpgradeSeqBatches.ps1</summary>
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
**Chunk 1**
|
||||||
|
Lines added: undefined, lines removed: 4
|
||||||
|
|
||||||
|
```diff
|
||||||
|
@@ -40,8 +40,4 @@
|
||||||
|
Copy-Item -Path $sourceFile -Destination $targetBat -Force
|
||||||
|
Write-Host "✓ Updated: $targetBat" -ForegroundColor Green
|
||||||
|
-
|
||||||
|
- # Copy the .ps1 file
|
||||||
|
- Copy-Item -Path $sourcePs1 -Destination $targetPs1 -Force
|
||||||
|
- Write-Host "✓ Updated: $targetPs1" -ForegroundColor Green
|
||||||
|
|
||||||
|
$updatedCount++
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<details><summary>Edit file: UpgradeSeqBatches.ps1</summary>
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
**Chunk 1**
|
||||||
|
Lines added: undefined, lines removed: 1
|
||||||
|
|
||||||
|
```diff
|
||||||
|
@@ -34,5 +34,4 @@
|
||||||
|
$targetDir = $targetFile.Directory.FullName
|
||||||
|
$targetBat = Join-Path $targetDir "UpdateSequences.bat"
|
||||||
|
- $targetPs1 = Join-Path $targetDir "UpdateSequences.ps1"
|
||||||
|
|
||||||
|
try {
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Perfect! Now `UpgradeSeqBatches.ps1` only copies the `.bat` files, which makes much more sense since:
|
||||||
|
|
||||||
|
✅ **Single source of truth**: All projects use the PS1 from your main ProjectStructure directory
|
||||||
|
✅ **No duplication**: PS1 files aren't scattered across multiple locations
|
||||||
|
✅ **Easier maintenance**: Updates to the PS1 only need to happen in one place
|
||||||
|
✅ **Cleaner output**: Only shows the .bat file updates
|
||||||
|
|
||||||
|
The script will now just update the `UpdateSequences.bat` files in each project, and they'll all point to the centralized `UpdateSequences.ps1` in your main directory. Much cleaner!
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**User**_
|
||||||
|
|
||||||
|
we can remove this too can't we?
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
_**Assistant**_
|
||||||
|
|
||||||
|
Absolutely! Since we're no longer copying the PS1 files, we don't need that variable anymore. Let me remove it:
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<details><summary>Edit file: UpgradeSeqBatches.ps1</summary>
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
**Chunk 1**
|
||||||
|
Lines added: undefined, lines removed: 1
|
||||||
|
|
||||||
|
```diff
|
||||||
|
@@ -2,5 +2,4 @@
|
||||||
|
|
||||||
|
$sourceFile = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.bat"
|
||||||
|
- $sourcePs1 = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.ps1"
|
||||||
|
|
||||||
|
if (-not (Test-Path $sourceFile)) {
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<details><summary>Edit file: UpgradeSeqBatches.ps1</summary>
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
**Chunk 1**
|
||||||
|
Lines added: 1, lines removed: 4
|
||||||
|
|
||||||
|
```diff
|
||||||
|
@@ -8,8 +8,5 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
- if (-not (Test-Path $sourcePs1)) {
|
||||||
|
- Write-Error "Source PowerShell file not found: $sourcePs1"
|
||||||
|
- exit 1
|
||||||
|
- }
|
||||||
|
+
|
||||||
|
|
||||||
|
Write-Host "=== Updating UpdateSequences.bat files ===" -ForegroundColor Cyan
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
<details><summary>Edit file: UpgradeSeqBatches.ps1</summary>
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
**Chunk 1**
|
||||||
|
Lines added: undefined, lines removed: 1
|
||||||
|
|
||||||
|
```diff
|
||||||
|
@@ -12,5 +12,4 @@
|
||||||
|
Write-Host "=== Updating UpdateSequences.bat files ===" -ForegroundColor Cyan
|
||||||
|
Write-Host "Source .bat: $sourceFile" -ForegroundColor White
|
||||||
|
- Write-Host "Source .ps1: $sourcePs1" -ForegroundColor White
|
||||||
|
Write-Host ""
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Perfect! Now the script is much cleaner and only focuses on what it actually needs:
|
||||||
|
|
||||||
|
✅ **Removed unused variables**: No more `$sourcePs1`
|
||||||
|
✅ **Simplified validation**: Only checks for the .bat file
|
||||||
|
✅ **Cleaner output**: Only shows the .bat source file
|
||||||
|
✅ **Focused purpose**: Just updates the .bat files that point to your centralized PS1
|
||||||
|
|
||||||
|
The script is now streamlined and only does what's necessary - updating the `UpdateSequences.bat` files across your projects so they all point to the single `UpdateSequences.ps1` in your main ProjectStructure directory.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
# Copy the current UpdateSequences.bat to all subfolders that have it
|
# Copy the current UpdateSequences.bat to all subfolders that have it
|
||||||
|
|
||||||
$sourceFile = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.bat"
|
$sourceFile = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.bat"
|
||||||
$sourcePs1 = "R:\Creative\artsy\maya\0 ProjectStructure\UpdateSequences.ps1"
|
|
||||||
|
|
||||||
if (-not (Test-Path $sourceFile)) {
|
if (-not (Test-Path $sourceFile)) {
|
||||||
Write-Error "Source file not found: $sourceFile"
|
Write-Error "Source file not found: $sourceFile"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not (Test-Path $sourcePs1)) {
|
|
||||||
Write-Error "Source PowerShell file not found: $sourcePs1"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "=== Updating UpdateSequences.bat files ===" -ForegroundColor Cyan
|
Write-Host "=== Updating UpdateSequences.bat files ===" -ForegroundColor Cyan
|
||||||
Write-Host "Source .bat: $sourceFile" -ForegroundColor White
|
Write-Host "Source .bat: $sourceFile" -ForegroundColor White
|
||||||
Write-Host "Source .ps1: $sourcePs1" -ForegroundColor White
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
|
|
||||||
# Find all UpdateSequences.bat files
|
# Find all UpdateSequences.bat files
|
||||||
@@ -33,17 +28,12 @@ $failedCount = 0
|
|||||||
foreach ($targetFile in $targetFiles) {
|
foreach ($targetFile in $targetFiles) {
|
||||||
$targetDir = $targetFile.Directory.FullName
|
$targetDir = $targetFile.Directory.FullName
|
||||||
$targetBat = Join-Path $targetDir "UpdateSequences.bat"
|
$targetBat = Join-Path $targetDir "UpdateSequences.bat"
|
||||||
$targetPs1 = Join-Path $targetDir "UpdateSequences.ps1"
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
# Copy the .bat file
|
# Copy the .bat file
|
||||||
Copy-Item -Path $sourceFile -Destination $targetBat -Force
|
Copy-Item -Path $sourceFile -Destination $targetBat -Force
|
||||||
Write-Host "✓ Updated: $targetBat" -ForegroundColor Green
|
Write-Host "✓ Updated: $targetBat" -ForegroundColor Green
|
||||||
|
|
||||||
# Copy the .ps1 file
|
|
||||||
Copy-Item -Path $sourcePs1 -Destination $targetPs1 -Force
|
|
||||||
Write-Host "✓ Updated: $targetPs1" -ForegroundColor Green
|
|
||||||
|
|
||||||
$updatedCount++
|
$updatedCount++
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user