Skip to content

Commit

Permalink
Merge pull request #17 from mills88812/altoids-symlink-time
Browse files Browse the repository at this point in the history
Altoids Symblink Magic
  • Loading branch information
BensoneWhite authored Jul 2, 2024
2 parents 62dfefd + 72c4b30 commit c44088e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Deadlands.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
<TargetFramework>net48</TargetFramework>
<LangVersion>12</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>portable</DebugType>
<WarningLevel>5</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>portable</DebugType>
<WarningLevel>5</WarningLevel>
</PropertyGroup>

<Target Name="GenerateMod" AfterTargets="PostBuildEvent">

Expand All @@ -26,5 +34,9 @@
<Private>false</Private>
</Reference>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="call symlinkHandler.bat" />
</Target>

</Project>
30 changes: 30 additions & 0 deletions src/symlinkHandler.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
if "%GITHUB_WORKSPACE%"=="" (call) else (
echo "Github Actions detected, not doing symlink stuff..."
exit /b 0
)
REM First step: find Rainworld's folder
set progfiles=C:/Program Files
set progfiles86=C:/Program Files (x86)
set rainworld=Rain World/RainWorld_Data/StreamingAssets
if "%DeadlandsLocation%"=="" (
echo "'DeadLandsLocation' not defined, automatically determining Rainworld's location..."
if EXIST "%progfiles%/Steam/steamapps/common/%rainworld%" (
set DeadlandsLocation="%progfiles%/Steam/steamapps/common/%rainworld%/mods/Deadlands"
) else if EXIST "%progfiles86%/Steam/steamapps/common/%rainworld%" (
set DeadlandsLocation="%progfiles86%/Steam/steamapps/common/%rainworld%/mods/Deadlands"
) else if EXIST "D:/Steam/steamapps/common/%rainworld%" (
set DeadlandsLocation="D:/Steam/steamapps/common/%rainworld%/mods/Deadlands"
) else (
echo "Unable to find the location of Deadland's mod folder within Rainworld!'"
exit /b 1
)
)
REM Second: Determine if Deadlands is already there; make a symlink if it isn't
if EXIST %DeadLandsLocation% (
echo "Symbolic link seemingly already exists! Cool c:"
) else (
echo "Generating symbolic link for Deadlands repo..."
echo %DeadLandsLocation%
echo "%cd%"
mklink /d %DeadLandsLocation% "%cd%/../mod"
)

0 comments on commit c44088e

Please sign in to comment.