Closed stennie closed 2 years ago
~/m
is rather dangerous, I frequently use single and double letter directory names for things I work with often. ~/.m
is a safer choice, there is also ~/.local
that e.g. python uses hence ~/.local/m
is perhaps an even better choice.
I would also expect non-mutating operations like m
and m ls
to work fine when the user invoking them does not have write access to /usr/local/m
(but if the latter exists, I expect m
to list versions installed therein).
@p-mongo Apparently .local
is part of the XDG spec so that seems a reasonable default. Thanks for the suggestion!
Agree on behaviour for non-mutating operations: only need to exit with an error if write access is required and the destination path is non-writeable.
Regards, Stennie
To simplify installation, the M_PREFIX environment variable should default to the user's home directory instead of
/usr/local/
. The/usr/local
default originates fromnpm install -g
.Expected behaviour variation for
npm
installation:m
(see: https://docs.npmjs.com/files/folders#tldr)Expected behaviour for install via
wget
:/usr/local/m
exists and is writeable, use/usr/local/m
/usr/local/m
exists and is not writeable, exit with message recommendingsudo chown -R $(whoami) /usr/local/m
/usr/local/m
doesn't exist, use~/m
General behaviour:
sudo chown -R $(whoami) $M_PREFIX