Skip to content

Commit

Permalink
Create .mm source blanks for macOS modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jul 6, 2024
1 parent b648548 commit 8c97e91
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Telegram/create.bat
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,30 @@ exit /b %errorlevel%
set "CommandPath=%1"
set "CommandPathUnix=!CommandPath:\=/!"
set "CommandPathWin=!CommandPath:/=\!"

if "!CommandPathUnix:~-4!" == "_mac" (
set "CommandExt=mm"
) else (
set "CommandExt=cpp"
)
if "!CommandPathUnix!" == "" (
echo Provide source path.
exit /b 1
) else if exist "SourceFiles\!CommandPathWin!.cpp" (
) else if exist "SourceFiles\!CommandPathWin!.!CommandExt!" (
echo This source already exists.
exit /b 1
)
echo Generating source !CommandPathUnix!.cpp..
mkdir "SourceFiles\!CommandPathWin!.cpp"
rmdir "SourceFiles\!CommandPathWin!.cpp"
echo Generating source !CommandPathUnix!.!CommandExt!..
mkdir "SourceFiles\!CommandPathWin!.!CommandExt!"
rmdir "SourceFiles\!CommandPathWin!.!CommandExt!"

call :write_comment !CommandPathWin!.cpp
call :write_comment !CommandPathWin!.!CommandExt!
set "quote="""
set "quote=!quote:~0,1!"
set "source1=#include !quote!!CommandPathUnix!.h!quote!"
(
echo !source1!
echo.
)>> "SourceFiles\!CommandPathWin!.cpp"
)>> "SourceFiles\!CommandPathWin!.!CommandExt!"
exit /b
)

Expand Down

0 comments on commit 8c97e91

Please sign in to comment.