From f82d352d66167f1e08b97d00d9fb6d05150a5c8e Mon Sep 17 00:00:00 2001 From: Drew Short Date: Tue, 16 Jan 2018 23:32:16 -0600 Subject: [PATCH] Working on moving the bootstrapper to moonscript --- gruntfile.js | 4 ++-- src/bootstrap.lua | 29 ----------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 src/bootstrap.lua diff --git a/gruntfile.js b/gruntfile.js index 6cb76f1..a51bfca 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -24,10 +24,10 @@ module.exports = function (grunt) { grunt.registerTask("compile-moonscript", "compiles moonscript files to lua", function() { grunt.file.expand({filter: 'isDirectory'}, "src/**").forEach(function (dir) { grunt.file.expand({filter: 'isFile'}, dir + "/*.moon").forEach(function (file) { - const directory = file.substr(0, file.lastIndexOf('/')).replace("src/",""); + const directory = file.substr(0, file.lastIndexOf('/') + 1).replace("src/",""); const file_name = file.substr(file.lastIndexOf('/') + 1); const file_name_sans_ext = file_name.substr(0, file_name.lastIndexOf('.')); - const output_path = "dist/" + directory + '/' + file_name_sans_ext + '.lua'; + const output_path = "dist/" + directory + file_name_sans_ext + '.lua'; const exec_task = grunt.config.get('exec') || {}; exec_task[file] = { diff --git a/src/bootstrap.lua b/src/bootstrap.lua deleted file mode 100644 index 07a6e3b..0000000 --- a/src/bootstrap.lua +++ /dev/null @@ -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") \ No newline at end of file