|
|
@ -1,29 +0,0 @@ |
|
|
|
--[[ |
|
|
|
SPM Bootstrap Installer |
|
|
|
Minimal functionality to install pull SPM and install itself. |
|
|
|
]] |
|
|
|
local component = require("component") |
|
|
|
local fs = require("filesystem") |
|
|
|
local wget = loadfile("/bin/wget.lua") |
|
|
|
|
|
|
|
if not component.isAvailable("internet") then |
|
|
|
io.stderr:write("This program requires an internet card to run.") |
|
|
|
return |
|
|
|
end |
|
|
|
|
|
|
|
local downloadSrc = "{URL_BASE}/spm/spm.min.lua" |
|
|
|
local saveLocation = "/tmp/spm.lua" |
|
|
|
|
|
|
|
print("Downloading Temporary SPM") |
|
|
|
wget("-qf", downloadSrc, saveLocation) |
|
|
|
|
|
|
|
local spm = loadfile(saveLocation) |
|
|
|
|
|
|
|
print("Installing SPM Locally") |
|
|
|
spm("install", "-f", "spm") |
|
|
|
|
|
|
|
print("Removing Temporary SPM") |
|
|
|
fs.remove(saveLocation) |
|
|
|
print("Removing bootstrap.lua") |
|
|
|
fs.remove(debug.getinfo(2, "S").source:sub(2)) |
|
|
|
print("Done") |