mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
* Update ecode-nightly.yml * Create patch_commit_number.ps1 * Update ecode-nightly.yml * Create copy_ecode_assets.ps1 * Update ecode-nightly.yml For consistency, all use backward slashes now. * Update ecode-nightly.yml * Update ecode-nightly.yml * Create build.app.ps1 * Update build.app.ps1 * Update ecode-nightly.yml * Update build.app.ps1 * Update build_sdl2.sh * Update ecode-nightly.yml * Update patch_commit_number.ps1 * Update build.app.ps1 * Update patch_commit_number.ps1 * Update copy_ecode_assets.ps1 * Update copy_ecode_assets.ps1 * Update build.app.ps1 * Update ecode-nightly.yml * Update ecode-nightly.yml
108 lines
3.1 KiB
PowerShell
108 lines
3.1 KiB
PowerShell
<#
|
|
.SYNOPSIS
|
|
Copy ecode assets from a source directory to a destination directory.
|
|
|
|
.USAGE
|
|
.\copy_ecode_assets.ps1 <source_dir> <dest_dir>
|
|
.EXAMPLE
|
|
.\copy_ecode_assets.ps1 .\bin .\ecode
|
|
#>
|
|
|
|
param (
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$SourceDir,
|
|
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$DestDir
|
|
)
|
|
|
|
# Ensure exactly two arguments
|
|
if ($args.Count -ne 2 -and (-not $PSBoundParameters.ContainsKey('SourceDir'))) {
|
|
Write-Error "Error: Exactly two arguments required: <source_dir> <dest_dir>"
|
|
Write-Host "Usage: .\copy_ecode_assets.ps1 <source_dir> <dest_dir>"
|
|
exit 1
|
|
}
|
|
|
|
Set-Location (Resolve-Path "$PSScriptRoot\..\..")
|
|
|
|
try {
|
|
$SourceDir = (Resolve-Path $SourceDir -ErrorAction Stop).Path
|
|
} catch {
|
|
Write-Error "Error: Source directory does not exist or cannot be resolved: $SourceDir"
|
|
exit 1
|
|
}
|
|
|
|
if (-not (Test-Path (Join-Path $SourceDir "assets"))) {
|
|
Write-Error "Error: Source assets directory not found: $SourceDir\assets"
|
|
exit 1
|
|
}
|
|
|
|
Write-Host "Copying assets from $SourceDir to $DestDir"
|
|
|
|
# Remove existing destination (if any)
|
|
if (Test-Path $DestDir) {
|
|
Remove-Item $DestDir -Recurse -Force
|
|
}
|
|
|
|
# Create required directories
|
|
$subDirs = "colorschemes","fonts","i18n","icon","ui","plugins"
|
|
foreach ($d in $subDirs) {
|
|
$target = Join-Path $DestDir "assets\$d"
|
|
try {
|
|
New-Item -ItemType Directory -Force -Path $target | Out-Null
|
|
} catch {
|
|
Write-Error "Error: Failed to create destination directories in $DestDir"
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
function Copy-FileOrDir($src, $dest) {
|
|
if (Test-Path $src) {
|
|
try {
|
|
Copy-Item $src -Destination $dest -Recurse -Force
|
|
} catch {
|
|
Write-Error "Error: Failed to copy $src -> $dest"
|
|
exit 1
|
|
}
|
|
} else {
|
|
Write-Error "Error: Source file/directory not found: $src"
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
# Copy whole directories
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\i18n") (Join-Path $DestDir "assets")
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\colorschemes") (Join-Path $DestDir "assets")
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\plugins") (Join-Path $DestDir "assets")
|
|
|
|
# Copy individual fonts
|
|
$fonts = @(
|
|
"DejaVuSansMono.ttf",
|
|
"DejaVuSansMono-Bold.ttf",
|
|
"DejaVuSansMono-Oblique.ttf",
|
|
"DejaVuSansMono-BoldOblique.ttf",
|
|
"DejaVuSansMonoNerdFontComplete.ttf",
|
|
"nonicons.ttf",
|
|
"codicon.ttf",
|
|
"NotoSans-Regular.ttf",
|
|
"NotoSans-Bold.ttf",
|
|
"NotoSans-Italic.ttf",
|
|
"NotoSans-BoldItalic.ttf",
|
|
"remixicon.ttf",
|
|
"NotoEmoji-Regular.ttf",
|
|
"NotoColorEmoji.ttf",
|
|
"DroidSansFallbackFull.ttf"
|
|
)
|
|
|
|
foreach ($font in $fonts) {
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\fonts\$font") (Join-Path $DestDir "assets\fonts")
|
|
}
|
|
|
|
# Copy other individual files
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\icon\ecode.png") (Join-Path $DestDir "assets\icon\ecode.png")
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\ui\breeze.css") (Join-Path $DestDir "assets\ui\breeze.css")
|
|
Copy-FileOrDir (Join-Path $SourceDir "assets\ca-bundle.pem") (Join-Path $DestDir "assets\ca-bundle.pem")
|
|
|
|
Write-Host "Assets successfully copied to $DestDir"
|
|
exit 0
|