Skip to content

Commit eb11696

Browse files
committed
refactor: 🗑️ removed submodules
repos requireing this repo via submodules will need to be updated
1 parent 9055530 commit eb11696

File tree

10 files changed

+66
-36
lines changed

10 files changed

+66
-36
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ on: [push, pull_request]
77
jobs:
88
test:
99
runs-on: ubuntu-latest
10-
1110
steps:
12-
- name: checkout
13-
uses: actions/checkout@v2
14-
with:
15-
submodules: true
16-
1711
- name: get lua
18-
uses: leafo/gh-actions-lua@v10
12+
uses: leafo/gh-actions-lua@v11
1913
with:
2014
luaVersion: "5.1"
2115

@@ -30,11 +24,11 @@ jobs:
3024
luarocks install luasocket
3125
luarocks install luasec
3226
33-
- name: Git Submodule Update
27+
- name: fetch dependencies
3428
run: |
35-
git pull --recurse-submodules
36-
git submodule update --remote --recursive
29+
chmod +x ./fetch-deps.sh
30+
./fetch-deps.sh
3731
3832
- name: test
3933
run: |
40-
busted .
34+
busted vector

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/config
22
/.vscode
33
/computer
4-
/suits
4+
/libs

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

fetch-deps.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# ---- Whats happening ---- #
4+
5+
# This fetches the dependencies listed in the "libs" variable and saves them in the targetFolder
6+
7+
8+
9+
set -e
10+
11+
libs=(
12+
"helperFunctions-lib"
13+
"eventCallStack-lib"
14+
"ccClass-lib"
15+
"testSuite-lib"
16+
)
17+
18+
# Basic setup variables
19+
repo="mc-cc-scripts"
20+
branch="master"
21+
targetFolderName=libs
22+
23+
24+
# fetch files.txt and save each file into the targetFolder
25+
fetch() {
26+
27+
files_txt=$(curl -fsSL "https://raw.githubusercontent.com/$repo/$1/$branch/files.txt")
28+
if [ -z "$files_txt" ]; then
29+
echo "Could not load files.txt for $1"
30+
exit 1
31+
fi
32+
while IFS= read -r FILE; do
33+
rm -f $targetFolderName/$1.lua # rm existing file
34+
curl -s "https://raw.githubusercontent.com/$repo/$1/$branch/$FILE" -o "$targetFolderName/$FILE"
35+
done < <(echo "$files_txt")
36+
}
37+
38+
mkdir -p $targetFolderName
39+
40+
for i in "${libs[@]}"; do
41+
fetch "$i"
42+
done

files.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
turtleEmulator.lua
2-
turtleMock.lua
2+
turtleMock.lua
3+
peripheral.lua
4+
defaultInteraction.lua
5+
defaultcheckActionValid.lua
6+
inventory/chestInventory.lua
7+
inventory/inventory.lua
8+
inventory/turtleInventory.lua

inventory/chestInventory.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
local class = require("./TestSuite-lib/ccClass/ccClass")
2-
local inventory = require("../inventory/inventory")
1+
local class = require("ccClass")
2+
local inventory = require("inventory")
33
---@class ChestInventory : Inventory
44
local chestInventory = class(inventory)
55

inventory/inventory.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
--#endregion
1919

2020

21-
local deepCopy = require("./TestSuite-lib/helperFunctions/helperFunctions").deepCopy
22-
local class = require("./TestSuite-lib/ccClass/ccClass")
21+
local deepCopy = require("helperFunctions").deepCopy
22+
local class = require("ccClass")
2323

2424
---# inventory
2525
---Inventory system emulated

inventory/turtleInventory.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
local class = require("./TestSuite-lib/ccClass/ccClass")
2-
local inventory = require("../inventory/inventory")
3-
local deepCopy = require("../TestSuite-lib/helperFunctions/helperFunctions").deepCopy
1+
local class = require("ccClass")
2+
local inventory = require("inventory")
3+
local deepCopy = require("helperFunctions").deepCopy
44
---@class TurtleInventory : Inventory
55
---@field protected _base Inventory the base inventory class
66
local turtleInventory = class(inventory, function (selfRef)

package.lua

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/test_spec.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@
2929
---@field equal function
3030
assert = assert
3131

32-
local spath =
33-
debug.getinfo(1,'S').source:sub(2):gsub("/+", "/"):gsub("[^/]*$",""):gsub("/tests", ""):gsub("tests", "")
34-
if spath == "" then
35-
spath = "./"
36-
end
37-
require(spath .. "package")
32+
package.path = package.path
33+
..";inventory/?.lua;"
34+
.."libs/?.lua;"
35+
.."libs/?/?.lua;"
3836

3937
-- load the other suits
4038
local vector = require("vector")

0 commit comments

Comments
 (0)