State deploy --path requires admin rights

When I tried a state deploy org/proj with the --path option to deploy to a folder I had set up, I got a message saying I needed to do this in an elevated shell with admin privileges. Why?

This was despite the fact that I wasn’t doing a system-level install and didn’t need or want the USER or SYSTEM PATH variables altered.

It seems to me that if I choose to deploy to a path that I have write access to, I should be able to do so without elevated permissions. Also, it seems to me, that setting the PATH variable at the system or user level is something that should be an option on the command.

Another useful option would be to echo the batch statements that might be needed to establish an environment in which you can execute the deployed instance of perl. For example:

setlocal
set PATH=<deployed_bin_location>;%PATH.

The user could then save these in a .bat file for use as an “activation” script.

Hi @jgpuckering, you should be able to force state deploy to deploy as non-admin by passing the --user flag.

2 Likes