mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-04-20 03:44:04 +01:00
refactor: update various todo comments with more info
This commit is contained in:
parent
249ed7e42f
commit
5eb2dd1a22
2 changed files with 13 additions and 3 deletions
|
@ -74,11 +74,17 @@ end
|
||||||
local TOOL_INSTALL_DIR = (dirs.homeDir() or error("Couldn't get home dir :(")):join(".pesde"):join("bin")
|
local TOOL_INSTALL_DIR = (dirs.homeDir() or error("Couldn't get home dir :(")):join(".pesde"):join("bin")
|
||||||
|
|
||||||
function installTool(tool: ToolId)
|
function installTool(tool: ToolId)
|
||||||
|
local toolStart = os.clock()
|
||||||
local toolAlias = tool.alias:unwrapOr(string.split(tool.repo, "/")[2])
|
local toolAlias = tool.alias:unwrapOr(string.split(tool.repo, "/")[2])
|
||||||
local toolInstallPath = TOOL_INSTALL_DIR:join(toolAlias)
|
print("toolAlias defaulting took", os.clock() - toolStart)
|
||||||
|
|
||||||
-- TODO: This is a bit too much overhead on startup and takes about 2s
|
local installStart = os.clock()
|
||||||
-- We can improve this by following what rokit does, where we symlink
|
local toolInstallPath = TOOL_INSTALL_DIR:join(toolAlias)
|
||||||
|
print("toolInstallPath joining took", os.clock() - installStart)
|
||||||
|
|
||||||
|
-- TODO: In order to eliminate fs read overhead on startup and to disallow
|
||||||
|
-- the use of the tool binary when outside a package where it is installed,
|
||||||
|
-- we can improve this by following what rokit does, where we symlink
|
||||||
-- the tool's path to this script, and check the file that we are being
|
-- the tool's path to this script, and check the file that we are being
|
||||||
-- invoked as, in order to figure out what tool to execute
|
-- invoked as, in order to figure out what tool to execute
|
||||||
|
|
||||||
|
@ -169,6 +175,8 @@ function installTool(tool: ToolId)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- TODO: Maintain multiple versions of a tool, and avoid downloading
|
||||||
|
-- the binary for a version again if it's already there
|
||||||
pathfs.move(binaryPath, toolInstallPath)
|
pathfs.move(binaryPath, toolInstallPath)
|
||||||
runTool(toolInstallPath)
|
runTool(toolInstallPath)
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,8 @@ local semver = require("./luau_packages/semver")
|
||||||
local Option = require("./lune_packages/option")
|
local Option = require("./lune_packages/option")
|
||||||
type Option<T> = Option.Option<T>
|
type Option<T> = Option.Option<T>
|
||||||
|
|
||||||
|
-- TODO: Use _G._PESDE_ROOT to get the install directory, then decode the
|
||||||
|
-- pesde manifest to get the version of the tool dynamically
|
||||||
core.installTool({
|
core.installTool({
|
||||||
alias = Option.Some("lune"),
|
alias = Option.Some("lune"),
|
||||||
repo = "lune-org/lune",
|
repo = "lune-org/lune",
|
||||||
|
|
Loading…
Add table
Reference in a new issue