-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
clarify how new environments are activated #1329
base: master
Are you sure you want to change the base?
Conversation
@@ -81,7 +81,12 @@ This lets us know `v1.1` is the **active environment**. | |||
The active environment is the environment that will be modified by Pkg commands such as `add`, `rm` and `update`. | |||
|
|||
Let's set up a new environment so we may experiment. | |||
To set the active environment, use `activate`: | |||
To set the active environment, use `activate` and then the name of the environment, or the path to it | |||
if it's not in your current working directory. |
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.
if it's not in your current working directory. | |
if it's not in your current working directory. (For reference, `activate someenv` will expand to `activate ./someenv`). |
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 don't think this is needed
Co-authored-by: Anshul Singhvi <[email protected]>
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 think the working directory in the example changed since this was opened
If the environment you want to activate doesn't exist yet, it will be created in your current working directory. | ||
If you want to change the working directory first, you can `cd` there after pressing `;` to get into shell mode. | ||
If you're not sure what the current working directory is you can run `pwd()` in the REPL. | ||
In our case, we are currently in the directory `/tmp/`, so the environment will be created there. |
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.
In our case, we are currently in the directory `/tmp/`, so the environment will be created there. | |
In our case, we are currently in the home directory, so the environment will be created there. |
One thing to keep in mind is that the name `tutorial` is not exclusive to our environment. | ||
If we cd to a different folder like `/different/` and run `activate tutorial`, we might expect our old environment | ||
to be activated, but instead a new environment named tutorial will be created in `/different/`. | ||
To activate our original environment from anywhere, we can always run `activate /tmp/tutorial`. |
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.
To activate our original environment from anywhere, we can always run `activate /tmp/tutorial`. | |
To activate our original environment from anywhere, we can always run `activate ~/tutorial`. |
I had to find out by trial and error that a new environment is created if I try to activate an existing environment from a different working directory. This wasn't clear to me after reading the docs, so this PR is meant to clarify the process.