feat: inform user about not finding any bin package when invoking from bin

This commit is contained in:
daimond113 2024-10-12 19:14:47 +02:00
parent 43a8d6272a
commit e430bdf89f
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 7 additions and 1 deletions

View file

@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Inform user about not finding any bin package when using its bin invocation by @daimond113
### Fixed
- Fix `self-upgrade` overwriting its own binary by @daimond113
- Allow use of Luau packages in `execute` command by @daimond113

View file

@ -51,6 +51,7 @@ fn bin_link_file(alias: &str) -> String {
format!(
r#"{prefix}local process = require("@lune/process")
local fs = require("@lune/fs")
local stdio = require("@lune/stdio")
local project_root = process.cwd
local path_components = string.split(string.gsub(project_root, "\\", "/"), "/")
@ -68,9 +69,11 @@ for _, packages_folder in {{ {all_folders} }} do
if fs.isFile(path) then
require(path)
break
return
end
end
stdio.ewrite(stdio.color("red") .. "binary `{alias}` not found. are you in the right directory?" .. stdio.color("reset") .. "\n")
"#,
)
}