Skip to content

Commit

Permalink
Fix config files being created wrong directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Natanxp2 committed Oct 31, 2024
1 parent 6777c32 commit 6e2158a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace BSPPackStandalone
{
public static class Config
{
public static string ExeDirectory = AppContext.BaseDirectory;
public static string BSPFile { get; set; }
public static string GameFolder { get; set; }
public static string SteamAppsPath { get; set; }
Expand Down Expand Up @@ -139,4 +140,4 @@ private static void CreateDefaultConfigFile(string filePath)
Environment.Exit(1);
}
}
}
}
8 changes: 4 additions & 4 deletions Pack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void Main(string[] args)
modify = args.Contains("-M") || args.Contains("--modify");
search = args.Contains("-S") || args.Contains("--search");

Config.LoadConfig("config.ini");
Config.LoadConfig(Path.Combine(Config.ExeDirectory, "config.ini"));

if (args.Length == 0)
{
Expand Down Expand Up @@ -81,7 +81,7 @@ Please provide path to BSP.
{
if(modify)
{
Config.CreateDefaultResourceConfigFile("ResourceConfig.ini");
Config.CreateDefaultResourceConfigFile(Path.Combine(Config.ExeDirectory, "ResourceConfig.ini"));
return;
}
else
Expand All @@ -92,7 +92,7 @@ Please provide path to BSP.
}

if(modify)
LoadPathsFromFile("ResourceConfig.ini");
LoadPathsFromFile(Path.Combine(Config.ExeDirectory, "ResourceConfig.ini"));

Console.WriteLine("Reading BSP...");
FileInfo fileInfo = new FileInfo(Config.BSPFile);
Expand Down Expand Up @@ -415,4 +415,4 @@ static void CompressBSP(bool decompress = false)
}
}
}
}
}
6 changes: 3 additions & 3 deletions bspPack.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>0.3.0</Version>
<Version>0.3.1</Version>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<SelfContained>true</SelfContained>
<ImplicitUsings>enable</ImplicitUsings>
Expand All @@ -12,12 +12,12 @@

<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
<OutputPath>bin/Windows</OutputPath>
<PublishDir>publish/Windows</PublishDir>
<PublishDir>publish/win-x64</PublishDir>
</PropertyGroup>

<PropertyGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
<OutputPath>bin/Linux</OutputPath>
<PublishDir>publish/Linux</PublishDir>
<PublishDir>publish/linux-x64</PublishDir>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 6e2158a

Please sign in to comment.