Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
luarocks install luasocket
luarocks install luasec
- name: Git Submodule Update
- name: fetch dependencies
run: |
git pull --recurse-submodules
git submodule update --init --remote --recursive
chmod +x ./fetch-deps.sh
./fetch-deps.sh
- name: test
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/libs
8 changes: 0 additions & 8 deletions .gitmodules

This file was deleted.

7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,4 @@ builder help
builder floor -w <width> -l <length> -m <"left"|"right">
```

# Dev - Documentaion

### Submodules used
- turtleControler-lib
- turtleEmulator-lib
- - plus submodules
# Dev - Documentaion
6 changes: 0 additions & 6 deletions ccPackage.lua

This file was deleted.

54 changes: 54 additions & 0 deletions fetch-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/bash

# ---- Whats happening ---- #

# This fetches the dependencies listed in the "libs" variable and saves them in the targetFolder



set -e

libs=(
"helperFunctions-lib"
"ccClass-lib"
"testSuite-lib"
"turtleEmulator-lib"
"turtleController-lib"
"eventHandler-lib"
)

# Basic setup variables
repo="mc-cc-scripts"
branch="master"
targetFolderName=libs


# fetch files.txt and save each file into the targetFolder
fetch() {
files_txt=$(curl -fsSL "https://raw.githubusercontent.com/$repo/$1/$branch/files.txt")
if [ -z "$files_txt" ]; then
echo "Could not load files.txt for $1"
exit 1
fi
while IFS= read -r FILE; do
url="https://raw.githubusercontent.com/$repo/$1/$branch/$FILE"

mkdir -p "$(dirname "$targetFolderName/$FILE")" # create the folder (and subfolders specified in the files.txt)
rm -f $targetFolderName/$FILE.lua # rm existing file
if ! curl -s -o "$targetFolderName/$FILE" "$url"; then
echo "could not get / write the file $i: '$FILE' to the folder '$targetFolderName'"
exit 1
fi
# echo "saved $1: '$FILE' in '$targetFolderName'"
done < <(echo "$files_txt")
}

if [[ $# -eq 0 ]]; then
# No arguments given, fetch all
for i in "${libs[@]}"; do
fetch "$i"
done
else
# Argument given, fetch arguemt
fetch "$1"
fi
10 changes: 5 additions & 5 deletions tests/test_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
---@field equal function
assert = assert

local spath = debug.getinfo(1,'S').source:sub(2):gsub("/+", "/"):gsub("[^/]*$",""):gsub("/tests", ""):gsub("tests","")
if spath == "" then
spath = "./"
end
require(spath.."ccPackage")
package.path = package.path .. ";"
.."libs/?.lua;"
.."libs/inventory/?.lua;"
.."libs/peripherals/?.lua;"

---@class Vector
_G.vector = require("vector")
---@class Builder_Lib
Expand Down
1 change: 0 additions & 1 deletion turtleController-lib
Submodule turtleController-lib deleted from 8816bf
1 change: 0 additions & 1 deletion turtleEmulator-lib
Submodule turtleEmulator-lib deleted from 6c4119
Loading