Skip to content

Commit b0226aa

Browse files
committed
Adapt to new insta folder structure
Closed #2
1 parent 8694612 commit b0226aa

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

lib/cmake_patcher.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class CMakePatcher
4-
SERVER_PREFIX = 'src/game/server'
4+
SERVER_PREFIX = 'src/insta/server'
55

66
def initialize(opts = {})
77
@cmake_path = opts[:path]
@@ -54,8 +54,8 @@ def build_new_cmake
5454
end
5555
end
5656

57-
# set_src(GAME_SERVER GLOB_RECURSE src/game/server
58-
in_set_src = true if line.match?(/set_src.GAME_SERVER.*src.game.server/)
57+
# set_src(INSTA_SERVER GLOB_RECURSE src/insta/server
58+
in_set_src = true if line.match?(/set_src.INSTA_SERVER.*src.insta.server/)
5959

6060
new_content += "#{line}\n"
6161
end
@@ -71,7 +71,7 @@ def build_new_cmake
7171
# @param old_files [Array<String>] The files currently in CMakeListst.txt
7272
# @param indent [Integer] Amount of spaces to indent from the beginning of the line
7373
# @return [Array<String>]
74-
def build_files_string(old_files, indent = 4)
74+
def build_files_string(old_files, indent = 6)
7575
old_files = old_files.map(&:strip)
7676
new_files = @new_files.map { |file| file.delete_prefix("#{SERVER_PREFIX}/") }
7777
# could also delete files here

lib/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# comments use YARD format
99
# https://rubydoc.info/gems/yard/file/docs/GettingStarted.md
1010

11-
CONTROLLER_BASE_DIR_INCLUDE = 'game/server/gamemodes'
11+
CONTROLLER_BASE_DIR_INCLUDE = 'insta/server/gamemodes'
1212
CONTROLLER_BASE_DIR_FS = "src/#{CONTROLLER_BASE_DIR_INCLUDE}".freeze
1313

1414
class Controller

lib/gamemode.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def initialize(opts = {})
1616
@parent_controller = opts[:parent] || Controller.base_pvp
1717

1818
@fs = FileSystemHelper.new
19-
@cmake = CMakePatcher.new
19+
@cmake = CMakePatcher.new(path: 'src/insta/CMakeLists.txt')
2020
end
2121

2222
def write_cpp_header

0 commit comments

Comments
 (0)