Closed W1M0R closed 1 month ago
It may also very well be, that for my particular use case I should just download the proto binary and bypass the install script, and maybe call proto upgrade and proto setup myself.
I'm currently using the following method to install proto and so far it looks like it is working the way I want it to:
$scriptUrl = "https://moonrepo.dev/install/proto.ps1"
$tmpScriptPath = Join-Path -Path $Env:TEMP -ChildPath "proto.ps1"
$wc = New-Object Net.Webclient
[void]($wc.downloadFile($scriptUrl, $tmpScriptPath))
pwsh.exe -ExecutionPolicy Bypass -File $tmpScriptPath --no-modify-profile --no-modify-path --yes
Another method for potentially solving the issue I'm having (i.e. where non-proto projects also need a .prototools file because of the shim in the PATH taking precedence by default - as it should), could be to modify the shim runner (proto-shim?
), so that it has the ability to automatically handle the Error: proto::tool::unknown
error, by temporarily modifying the PATH environment variable of the shim to exclude the .proto/shim
and .proto/bin
files, and then to execute the requested command, in that way bypassing proto entirely for that error case.
I still think I'm doing something wrong here. Installing just
globally via proto
(proto install just
) should allow just
to work from any directory without needing a .prototools
file, am I right in saying that? Or am I supposed to run proto install just --pin global
?
@W1M0R
The proto.ps1 install script does seem to allow arguments, I'm just not sure how to invoke it using
irm https://moonrepo.dev/install/proto.ps1 | iex
.
I've had the same thought before and couldn't find any information on this. Totally open to supporting env vars for this.
Another method for potentially solving the issue I'm having (i.e. where non-proto projects also need a .prototools file because of the shim in the PATH taking precedence by default - as it should), could be to modify the shim runner (
proto-shim?
), so that it has the ability to automatically handle theError: proto::tool::unknown
error, by temporarily modifying the PATH environment variable of the shim to exclude the.proto/shim
and.proto/bin
files, and then to execute the requested command, in that way bypassing proto entirely for that error case.
Let me dig into this a bit more. This is definitely something I want to support if possible, as I agree, onboarding should be easy and not a blocker.
I still think I'm doing something wrong here. Installing
just
globally viaproto
(proto install just
) should allowjust
to work from any directory without needing a.prototools
file, am I right in saying that? Or am I supposed to runproto install just --pin global
?
Yeah the version is not pinned at all unless --pin
is provided, and it's also local by default. You can use this setting however: https://moonrepo.dev/docs/proto/config#pin-latest
Landed env vars in v0.39.
What version?
0.38.2
Which command?
irm https://moonrepo.dev/install/proto.ps1 | iex
What happened?
I want to adopt
proto
on a per-project basis. Projects that don't useproto
, should not be affected byproto
shims and bins. A simple way to do this, is to not let theproto
installer modify the environment (specifically the PATH variable), and then on a per-project basis we can do something likeproto activate --export pwsh
(or just manipulate the environment ourselves).Running
irm https://moonrepo.dev/install/proto.ps1 | iex
modifies thePATH
, even ifNone
is selected to prevent modification of the shell profile. It looks like the installer script calls intoproto setup
which does offer the flags I need:--no-modify-profile
,--no-modify-path
.The
proto.ps1
install script does seem to allow arguments, I'm just not sure how to invoke it usingirm https://moonrepo.dev/install/proto.ps1 | iex
. My gut feel is that I'd probably have to download theproto.ps
script and then execute the script directly without piping it to iex. This is fine, but a bit clumsy.Maybe a
PROTO_SETUP_ARGS
can be respected by the installer, e.g:Without this proposed change, ie. proto is added to the PATH by default after installation. As soon as a project uses a .prototools file to install a utility, e.g.
just
, then all other projects that usejust
(but notproto
) will suddenly be greeted by thejust
proto shim (instead of their global just - perhaps installed via Windowsscoop install just
:Those users shouldn't need to add a
.prototools
file to their project. E.g. their non-proto project worked yesterday, but after cloning a new project (that uses and installs proto), their non-proto project doesn't want to work anymore.Trace logs?
No response
Operating system?
Windows
Architecture?
x64