Skip to content

Commit

Permalink
Added Post-build for TgDownloaderConsole
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianMorozov committed Dec 1, 2024
1 parent 5fad419 commit 6a9ddf1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Clients/TgDownloaderConsole/Post-build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@echo off
cls
setlocal
set "sourceDir=..\..\..\TgDownloader-Helpers\"
set "destDir=.\"
set "fileSession=TgDownloader.session"
set "fileXml=TgDownloader.xml"

echo ------------------------------------------------------------
echo --- TgDownloaderConsole/Post-build.cmd ---
echo ------------------------------------------------------------
echo [ ] Start job
call :job "%sourceDir%%fileSession%"
call :job "%sourceDir%%fileXml%"
goto end

:job
echo [ ] Check file exists: "%~1"
if exist "%~1" (
xcopy "%~1" "%destDir%" /Y /S /Q /F /R /V >nul
echo [v] File exists and was updated from source
) else (
echo [!] File does not exist
)
goto :eof

:end
echo [ ] End job
endlocal

:exit
echo [ ] Exit from console
11 changes: 11 additions & 0 deletions Clients/TgDownloaderConsole/TgDownloaderConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,15 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<None Update="TgDownloader.session">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="TgDownloader.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="Post-build.cmd" />
</Target>
</Project>

0 comments on commit 6a9ddf1

Please sign in to comment.