Skip to content

Commit

Permalink
fix(basalt): Use basalt.lua instead of the whole repository (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiriks74 committed Oct 1, 2024
1 parent 2e41ac3 commit 719640f
Show file tree
Hide file tree
Showing 7 changed files with 3,037 additions and 103 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "lib/cc-tweaked"]
path = lib/cc-tweaked
url = https://github.com/jiriks74/CCTweaked-LSP
[submodule "lib/basalt"]
path = lib/basalt
url = https://github.com/Pyroxenium/Basalt.git
38 changes: 0 additions & 38 deletions install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
local owner = "jiriks74"
local repo = "ccTune"
local baseUrl = "https://raw.githubusercontent.com/" .. owner .. "/" .. repo .. "/refs/heads/main/"
local baseLibUrl = "https://raw.githubusercontent.com/Pyroxenium/Basalt/8dd8e63d21752f2fe621b04b9db0aeb155fedf0d/"
-- ^Settings

local installed = false
Expand Down Expand Up @@ -68,7 +67,6 @@ else
end

local files = {}
local libFiles = {}

while true do
local line = versionResponse.readLine()
Expand All @@ -78,28 +76,13 @@ while true do
end
end

local libResponse = http.get(baseUrl .. "libFiles.txt")
if libResponse == nil then error("Error fetching lib info!") end

while true do
local line = libResponse.readLine()
if not line then break end
if line:match("%S+") then
table.insert(libFiles, line)
end
end

if installed then
print("Removing old files...")

for _, file in ipairs(files) do
print(" Deleting `" .. file .. "`...")
fs.delete(file)
end
for _, file in ipairs(libFiles) do
print(" Deleting `" .. file .. "`...")
fs.delete(file)
end
end

if not fs.isDir("lib") then
Expand All @@ -109,14 +92,6 @@ if not fs.isDir("lib") then
print("Creating lib/linkBuilders directory")
fs.makeDir("lib/linkBuilders")
end
if not fs.isDir("lib/basalt") then
print("Creating lib/basalt directory")
fs.makeDir("lib/basalt")
if not fs.isDir("lib/basalt/Basalt") then
print("Creating lib/basalt/Basalt directory")
fs.makeDir("lib/basalt/Basalt")
end
end
end

print("Pulling files...")
Expand All @@ -134,19 +109,6 @@ for _, file in ipairs(files) do
fp.close()
end

for _, file in ipairs(libFiles) do
print(" Downloading `" .. file .. "`...")

local fp = fs.open(file, "w")
if fp == nil then error("Error creating file `" .. file .. "`!") end

local downloadResponse = http.get(baseLibUrl .. file:gsub("^lib/basalt/", ""))
if downloadResponse == nil then error("Error downloading " .. baseLibUrl .. file:gsub("^lib/basalt/", "") .. "!") end

fp.write(downloadResponse.readAll())
fp.close()
end

print("Finished installing.")
print("The computer will reboot in 5 seconds...")
print()
Expand Down
1 change: 0 additions & 1 deletion lib/basalt
Submodule basalt deleted from 8dd8e6
3,033 changes: 3,033 additions & 0 deletions lib/basalt.lua

Large diffs are not rendered by default.

57 changes: 0 additions & 57 deletions libFiles.txt

This file was deleted.

4 changes: 2 additions & 2 deletions play.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local player = require("lib.Player")
local basalt = require("lib.basalt.Basalt")
local basalt = require("lib.basalt")
local playlist

local currentSongUrl
Expand Down Expand Up @@ -135,7 +135,7 @@ local function watchdog()
playThread.stop()
return
end
sleep(0.75)
sleep(1)
end
end

Expand Down
4 changes: 2 additions & 2 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@version 2.0.1
@version 2.0.2
play.lua
version.txt
libFiles.txt
lib/basalt.lua
lib/Player.lua
lib/linkBuilders/Nextcloud.lua

0 comments on commit 719640f

Please sign in to comment.