Open shanipribadi opened 3 hours ago
Looking at the code https://github.com/moonrepo/proto/blob/d7c38b19037dabc6d69d5c009b6cc34e64d5c358/crates/core/src/flow/install.rs#L46
pub fn is_installed(&self) -> bool {
let dir = self.get_product_dir();
self.version
.as_ref()
// Canary can be overwritten so treat as not-installed
.is_some_and(|v| {
!v.is_latest()
&& !v.is_canary()
&& self.inventory.manifest.installed_versions.contains(v)
})
&& dir.exists()
&& !fs::is_dir_locked(dir)
}
The comment seem to suggest that this is an intentional behaviour,
and right now proto will not attempt to reinstall/overwrite if we run proto install some_tool some_version
once it's been installed.
I think having a
proto install --force some_tool some_version
command line argument to force reinstallation of an installed tool,
and removing the !v.is_canary()
check on flow::install,
will make using canary with proto more convenient.
Or alternatively just have a special case where proto install tool
with version as canary still reinstall the tool, but on using the tool from the shim it doesn't reinstall again if it is already there, so that we don't need the --force
flag.
What version?
0.41.1
Which command?
proto install
What happened?
I tried installing deno and bun using the following commands
which successfully download and install the canary version
then running the tool using
always give the following error
or
enabling auto-install does allow the command to run, but only after installing it again, which is slowing things down and waste bandwidth.
Expectation is that once the canary version is installed, proto is able to resolve the installed tool and use it, and only reinstall the canary version when we requested it specifically with
proto install --canary deno|bun
Trace logs?
Operating system?
Linux
Architecture?
x64