mirror of
https://github.com/pesde-pkg/tooling.git
synced 2024-12-12 07:10:36 +00:00
chore(LICENSE): rename to include markdown ext
This commit is contained in:
parent
ce6345443a
commit
d28408fc12
4 changed files with 30 additions and 12 deletions
7
LICENSE.md
Normal file
7
LICENSE.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Copyright © 2024 pesde-pkg
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -1 +1,2 @@
|
||||||
require("./lune_packages/core")("JohnnyMorganz/stylua", _G.PESDE_ROOT)
|
local process = require("@lune/process")
|
||||||
|
process.exit(require("./lune_packages/core")("JohnnyMorganz/stylua", _G.PESDE_ROOT))
|
||||||
|
|
1
toolchainlib/LICENSE.md
Symbolic link
1
toolchainlib/LICENSE.md
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../LICENSE.md
|
|
@ -203,7 +203,7 @@ return setmetatable(
|
||||||
installTool = installTool,
|
installTool = installTool,
|
||||||
} :: LibExports,
|
} :: LibExports,
|
||||||
{
|
{
|
||||||
__call = function(lib: LibExportsImpl, tool: string, pesdeRoot: string?)
|
__call = function(lib: LibExportsImpl, tool: string, pesdeRoot: string?): number
|
||||||
-- TODO: Progress bar maybe? :D
|
-- TODO: Progress bar maybe? :D
|
||||||
|
|
||||||
local ERROR_PREFIX = `{stdio.color("red")}{stdio.style("bold")}error{stdio.color("reset")}:`
|
local ERROR_PREFIX = `{stdio.color("red")}{stdio.style("bold")}error{stdio.color("reset")}:`
|
||||||
|
@ -211,13 +211,13 @@ return setmetatable(
|
||||||
local repo, version = string.match(tool, "([^@]+)@?(.*)")
|
local repo, version = string.match(tool, "([^@]+)@?(.*)")
|
||||||
if repo == nil then
|
if repo == nil then
|
||||||
stdio.ewrite(`{ERROR_PREFIX} Invalid tool provided\n`)
|
stdio.ewrite(`{ERROR_PREFIX} Invalid tool provided\n`)
|
||||||
process.exit(1)
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local function manifestVersion(): string
|
local function manifestVersion(): (number, string?)
|
||||||
if pesdeRoot == nil then
|
if pesdeRoot == nil then
|
||||||
stdio.ewrite(`{ERROR_PREFIX} Failed to discover pesde package root\n`)
|
stdio.ewrite(`{ERROR_PREFIX} Failed to discover pesde package root\n`)
|
||||||
process.exit(1)
|
return 1, nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use _G.PESDE_ROOT to get the install directory, then decode the
|
-- Use _G.PESDE_ROOT to get the install directory, then decode the
|
||||||
|
@ -229,10 +229,10 @@ return setmetatable(
|
||||||
stdio.ewrite(
|
stdio.ewrite(
|
||||||
`{ERROR_PREFIX} Failed to decode bundled manifest. This is probably a bug.\n\n{manifest}`
|
`{ERROR_PREFIX} Failed to decode bundled manifest. This is probably a bug.\n\n{manifest}`
|
||||||
)
|
)
|
||||||
process.exit(1)
|
return 1, nil
|
||||||
end
|
end
|
||||||
|
|
||||||
return manifest.version
|
return 0, manifest.version
|
||||||
end
|
end
|
||||||
|
|
||||||
local toolId = string.gsub(repo :: string, "/", "+")
|
local toolId = string.gsub(repo :: string, "/", "+")
|
||||||
|
@ -241,9 +241,17 @@ return setmetatable(
|
||||||
`{toolAlias}-` .. if version ~= "" then version :: string else manifestVersion()
|
`{toolAlias}-` .. if version ~= "" then version :: string else manifestVersion()
|
||||||
)
|
)
|
||||||
|
|
||||||
print(toolInstallPath)
|
|
||||||
if pathfs.isFile(toolInstallPath) then
|
if pathfs.isFile(toolInstallPath) then
|
||||||
process.exit(lib.runTool(toolInstallPath))
|
return lib.runTool(toolInstallPath)
|
||||||
|
end
|
||||||
|
|
||||||
|
local versionOrDefault: string = version :: string
|
||||||
|
if versionOrDefault == "" then
|
||||||
|
local code, ver = manifestVersion()
|
||||||
|
if code ~= 0 then
|
||||||
|
return code
|
||||||
|
end
|
||||||
|
versionOrDefault = ver :: string
|
||||||
end
|
end
|
||||||
|
|
||||||
local ok, err = pcall(
|
local ok, err = pcall(
|
||||||
|
@ -251,9 +259,7 @@ return setmetatable(
|
||||||
{
|
{
|
||||||
alias = Option.None,
|
alias = Option.None,
|
||||||
repo = repo,
|
repo = repo,
|
||||||
version = Option.Some(
|
version = Option.Some(Semver.parse(versionOrDefault):unwrap()) :: Option<Semver.SemverImpl>,
|
||||||
Semver.parse(if version ~= "" then version :: string else manifestVersion()):unwrap()
|
|
||||||
) :: Option<Semver.SemverImpl>,
|
|
||||||
} :: ToolId,
|
} :: ToolId,
|
||||||
toolInstallPath
|
toolInstallPath
|
||||||
)
|
)
|
||||||
|
@ -261,7 +267,10 @@ return setmetatable(
|
||||||
if not ok then
|
if not ok then
|
||||||
stdio.ewrite(`{ERROR_PREFIX} Failed to install {tool}\n`)
|
stdio.ewrite(`{ERROR_PREFIX} Failed to install {tool}\n`)
|
||||||
stdio.ewrite(` - {err}\n`)
|
stdio.ewrite(` - {err}\n`)
|
||||||
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return 0
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue