@@ -0,0 +1,91 @@
3+It is easier to use the Mac installer, but it should be possible to install by running the following commands in your terminal:
6+# Move to your Desktop so you can see what is going on easier.
10+# Download the 0.19.0 binary for Linux.
12+# +-----------+----------------------+
14+# +-----------+----------------------+
15+# | -L | follow redirects |
16+# | -o elm.gz | name the file elm.gz |
17+# +-----------+----------------------+
19+curl -L -o elm.gz https://github.com/elm/compiler/releases/download/0.19.0/binary-for-mac-64-bit.gz
21+# There should now be a file named `elm.gz` on your Desktop.
23+# The downloaded file is compressed to make it faster to download.
24+# This next command decompresses it, replacing `elm.gz` with `elm`.
28+# There should now be a file named `elm` on your Desktop!
30+# Every file has "permissions" about whether it can be read, written, or executed.
31+# So before we use this file, we need to mark this file as executable:
35+# The `elm` file is now executable. That means running `~/Desktop/elm --help`
36+# should work. Saying `./elm --help` works the same.
38+# But we want to be able to say `elm --help` without specifying the full file
39+# path every time. We can do this by moving the `elm` binary to one of the
40+# directories listed in your `PATH` environment variable:
42+sudo mv elm /usr/local/bin/
44+# Now it should be possible to run the `elm` binary just by saying its name!
51+## What is the `PATH` variable?
53+When you run a command like `elm make src/Main.elm`, your computer starts by trying to find an executable file called `elm`.
55+The `PATH` is the list of directories that get searched. You can see these directories by running:
61+This prints `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin` on my computer. The directories are separated by a `:` so there are five possibilities listed here.
63+When I run `elm make src/Main.elm`, my terminal starts by searching these five directories for an executable file named `elm`. It finds `/usr/local/bin/elm` and then runs `/usr/local/bin/elm make src/Main.elm` with whatever arguments I gave.
65+So the `PATH` environment variable is a convention that allows you to refer to a specific executable file without knowing exactly where it lives on your computer. This is actually how all "terminal commands" work! Commands like `ls` are really executable files that live in directories listed in your `PATH` variable.
67+So the point of running `sudo mv elm /usr/local/bin/` is to turn the `elm` binary into a terminal command, allowing us to call it just like `ls` and `cd`.
69+**Note:** Why do we need to use `sudo` for that one command? Imagine if some program was able to add executables named `ls` or `cd` to `/usr/local/bin` that did something tricky and unexpected. That would be a security problem! Many distributions make this scenario less likely by requiring special permissions to modify the `/usr/local/bin/` directory.
76+The following commands should remove everything:
79+# Remove the `elm` executable.
81+sudo rm /usr/local/bin/elm
83+# Remove any cached files. The files here reduce compile times when
84+# starting new projects and make it possible to work offline in more
85+# cases. No need to keep it around if you are uninstalling though!
90+If you have any Elm projects still on your computer, you can remove their `elm-stuff/` directories as well.