Skip to content

Commit 76a6f77

Browse files
committed
fix the issue of unwanted newlines in version/channel files, ugh
1 parent 5b46a56 commit 76a6f77

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
fetch-depth: 0
2525

2626
- name: Create channel file
27-
run: echo ${{ env.BME_CHANNEL }} > ./installer/source/bme/bme_channel.txt
27+
run: echo "${{ env.BME_CHANNEL }}" | Out-File -Encoding ascii ./installer/source/bme/bme_channel.txt -NoNewline
2828
- name: Override version file (release only)
2929
if: github.event_name == 'workflow_dispatch'
30-
run: echo ${{ inputs.version }} > ./bme_version.txt
30+
run: echo "${{ inputs.version }}" | Out-File -Encoding ascii ./bme_version.txt -NoNewline
3131

3232
- name: Add msbuild to PATH
3333
uses: microsoft/setup-msbuild@v2

bmedll/FileSystemManager.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ FileSystemManager::FileSystemManager(const std::string& basePath)
8585
m_compiledPath = m_basePath / "r1_modsrc";
8686
m_dumpPath = m_basePath / "assets_dump";
8787
m_modsPath = m_basePath / "mods";
88-
m_savesPath = m_basePath / "saves";
89-
m_spawnlistsPath = m_basePath / "spawnlists";
9088
if (!fs::exists(m_bspPath))
9189
m_logger->error("bsp file does not exist at: {}", m_bspPath.string().c_str());
9290

@@ -170,8 +168,6 @@ void FileSystemManager::EnsurePathsCreated()
170168
fs::create_directories(m_dumpPath);
171169
fs::create_directories(m_compiledPath);
172170
fs::create_directories(m_modsPath);
173-
fs::create_directories(m_savesPath);
174-
fs::create_directories(m_spawnlistsPath);
175171
}
176172

177173
// TODO: Do we maybe need to add the search path in a frame hook or will this do?
@@ -540,13 +536,3 @@ const fs::path& FileSystemManager::GetCompilePath()
540536
{
541537
return m_compiledPath;
542538
}
543-
544-
const fs::path& FileSystemManager::GetSavesPath()
545-
{
546-
return m_savesPath;
547-
}
548-
549-
const fs::path& FileSystemManager::GetSpawnlistsPath()
550-
{
551-
return m_spawnlistsPath;
552-
}

bmedll/FileSystemManager.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ class FileSystemManager
1515
fs::path m_compiledPath;
1616
fs::path m_dumpPath;
1717
fs::path m_modsPath;
18-
fs::path m_savesPath;
19-
fs::path m_spawnlistsPath;
2018
std::vector<std::string> m_mapVPKs;
2119
std::vector<std::string> m_mapNames;
2220
std::string m_lastMapReadFrom;
@@ -51,6 +49,4 @@ class FileSystemManager
5149
const fs::path& GetBasePath();
5250
const fs::path& GetModsPath();
5351
const fs::path& GetCompilePath();
54-
const fs::path& GetSavesPath();
55-
const fs::path& GetSpawnlistsPath();
5652
};

bmedll/TTFSDK.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ const std::string GetBMEChannel()
109109
chan = sstr.str();
110110
}
111111
else chan = std::string(BME_CHANNEL);
112+
const auto rtrim = [](std::string_view str) -> std::string_view
113+
{
114+
const auto pos(str.find_last_not_of(" \t\n\r\f\v"));
115+
str.remove_suffix(std::min(str.length() - pos - 1, str.length()));
116+
return str;
117+
};
118+
chan = rtrim(chan);
112119
return chan;
113120
}
114121

0 commit comments

Comments
 (0)