|
|
@ -2,9 +2,7 @@ |
|
|
|
SPM Bootstrap Installer |
|
|
|
Minimal functionality to install pull SPM and install itself. |
|
|
|
]] |
|
|
|
|
|
|
|
local component = require("component") |
|
|
|
|
|
|
|
local wget = loadfile("/bin/wget.lua") |
|
|
|
|
|
|
|
if not component.isAvailable("internet") then |
|
|
@ -12,24 +10,17 @@ if not component.isAvailable("internet") then |
|
|
|
return |
|
|
|
end |
|
|
|
|
|
|
|
local downloadSrc |
|
|
|
|
|
|
|
if "{MINIFIED}" == "true" then |
|
|
|
downloadSrc = "{URL_BASE}/spm/spm.min.lua" |
|
|
|
else |
|
|
|
downloadSrc = "{URL_BASE}/spm/spm.lua" |
|
|
|
end |
|
|
|
|
|
|
|
local downloadSrc = "{URL_BASE}/spm/spm.min.lua" |
|
|
|
local saveLocation = "/tmp/spm.lua" |
|
|
|
|
|
|
|
term.write("Downloading Temporary SPM\n") |
|
|
|
print("Downloading Temporary SPM") |
|
|
|
wget("-q", downloadSrc, saveLocation) |
|
|
|
|
|
|
|
local spm = require(saveLocation) |
|
|
|
|
|
|
|
term.write("Installing SPM Locally\n") |
|
|
|
print("Installing SPM Locally") |
|
|
|
spm("install", "spm") |
|
|
|
|
|
|
|
term.write("Removing Temporary SPM\n") |
|
|
|
print("Removing Temporary SPM") |
|
|
|
fs.remove(saveLocation) |
|
|
|
term.write("Done\n") |
|
|
|
print("Done") |