local fs = require("filesystem") --[[ Bit Package Manager v1.0.0 Available commands: install - install a package remove - remove an installed package addrepo - add a repository remrepo - remove a repository update - update all installed packages ]] -- args is positional -- ops are - local args, ops = shell.parse() function getAvailableRepositories() local repos = {} if fs.isDirectory("/etc/bpm") then local file = io.open("/etc/bpm/repos.txt", "r") i = 1 for line in file:lines() do repos[i] = line i += 1 end file:close() else fs.makeDirectory("/etc/bpm") fs.open("/etc/bpm/repos.txt", "w"):write("https://reign-network.co.uk/minecraft/package-manager/packages"):close() return repos end local repos = getAvailableRepositories() function downloadPackageData(url, tmpPath) --[[ 1. Download from url, 2. Store in a tmp folder 3. return package metadata ]] end -- COMMANDS --- function install(packageName) --[[ 1. Search available repositories for packageName 2. Install if we find it ]] end function search(packageName) for repo in repos do end end if #args == 0 then -- Print help command print(" === Bit Package Manager v1.0.0 ===") print(" Available commands:") print(" install ; Installs a package") print(" search ; Search available repos for a package") print(" remove ; Removes a package") print(" addrepo ; Adds a package repository") print(" remrepo ; Removes a package repository") exit(0) end if args[1] == "install" then if #args >= 2 then install(args[2]) end else if args[1] == "search" then if #args >= 2 then search(args[2]) end