-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --dest flag for installer #4
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,19 @@ | |
# NOTE: Heavily inspired by get-stack.hs script for installing stack. | ||
# https://raw.githubusercontent.com/commercialhaskell/stack/stable/etc/scripts/get-stack.sh | ||
|
||
HOME_LOCAL_BIN="$HOME/.local/bin" | ||
HOME_LOCAL_SHARE="$HOME/.local/share" | ||
# Default install directory | ||
INSTALL_DIR="$HOME" | ||
|
||
while getopts ":d:" opt; do | ||
case $opt in | ||
d) INSTALL_DIR="$OPTARG" ;; | ||
*) echo "Invalid argument: -$OPTARG" >&2; exit 1 ;; | ||
esac | ||
done | ||
|
||
# Assign the directories | ||
HOME_LOCAL_BIN="$INSTALL_DIR/.local/bin" | ||
HOME_LOCAL_SHARE="$INSTALL_DIR/.local/share" | ||
Comment on lines
+7
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea with the installation destination! Unfortunately, these locations (i.e., Coincidentally, this is exactly what @infomiho and me have been talking about for the last couple of days! Check this comment for the full explanation (it's a whole thing with a long history): wasp-lang/wasp#953 (comment) Anyway:
EDIT: Also, what Miho said here: #4 (comment). It might make sense to postpone doing this in the interest of simplifying the (not-yet-existing) uninstallation process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was intended to make working with online IDEs (Replit, GitPod) a bit easier, as we sometimes need to change the installation destination to get it working correctly on these environements. See: https://github.com/wasp-lang/replit-template/tree/vince-add-replit-template There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, this was per my suggestion, and I didn't think much about uninstalling at that point! I would suggest the following, to keep it simple: we go with this, but don't tell users about it, so it is mostly just for us and potentially for some power users. The first version of uninstall, the simple one, will work for everyone that use default paths. It won't work for us and maybe for some very rare power users, but in that case we assume us/them know what they are doing anyway, for now. Once we do a solution with XDG paths, we can refactor all of this, but then we can do it in one coherent go. I wouldn't let that stop us right now though to get out what we need. But would certainly, in an issue for XDG paths, mention that right now we have an option to install in different than default path, that we need it for replit, and that we should make sure we can still do what we need for replit. |
||
WASP_TEMP_DIR= | ||
VERSION_ARG= | ||
|
||
|
@@ -15,10 +26,10 @@ RESET="\033[0m" | |
|
||
while [ $# -gt 0 ]; do | ||
case "$1" in | ||
# -d|--dest) | ||
# DEST="$2" | ||
# shift 2 | ||
# ;; | ||
-d|--dest) | ||
INSTALL_DIR="$2" | ||
shift 2 | ||
;; | ||
-v|--version) | ||
VERSION_ARG="$2" | ||
shift 2 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this part is redundant since you already picked up the argument below, where we also read other arguments?