Browse Source

Fixing bootstrap

environments/production/deployments/24
Drew Short 7 years ago
parent
commit
1e4a936baa
  1. 19
      src/bootstrap.lua

19
src/bootstrap.lua

@ -2,9 +2,7 @@
SPM Bootstrap Installer SPM Bootstrap Installer
Minimal functionality to install pull SPM and install itself. Minimal functionality to install pull SPM and install itself.
]] ]]
local component = require("component") local component = require("component")
local wget = loadfile("/bin/wget.lua") local wget = loadfile("/bin/wget.lua")
if not component.isAvailable("internet") then if not component.isAvailable("internet") then
@ -12,24 +10,17 @@ if not component.isAvailable("internet") then
return return
end 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" local saveLocation = "/tmp/spm.lua"
term.write("Downloading Temporary SPM\n")
print("Downloading Temporary SPM")
wget("-q", downloadSrc, saveLocation) wget("-q", downloadSrc, saveLocation)
local spm = require(saveLocation) local spm = require(saveLocation)
term.write("Installing SPM Locally\n")
print("Installing SPM Locally")
spm("install", "spm") spm("install", "spm")
term.write("Removing Temporary SPM\n")
print("Removing Temporary SPM")
fs.remove(saveLocation) fs.remove(saveLocation)
term.write("Done\n")
print("Done")
Loading…
Cancel
Save