Skip to content

Commit

Permalink
[docker] update install page.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Wang <skygragon@gmail.com>
  • Loading branch information
skygragon committed Dec 27, 2017
1 parent 9924e4b commit 7ed01d8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="docs/logo.png" width="350" align="right">
<img src="https://github.com/skygragon/leetcode-cli/raw/master/docs/logo.png" width="350" align="right">

# leetcode-cli

Expand Down
30 changes: 19 additions & 11 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,57 @@ title: Installation

# Prerequisites

`node.js` (`npm` included) required, please follow the installation guide:
Install the latest LTS version of `node.js` (`npm` included):

* [Install from package manager](https://nodejs.org/en/download/package-manager/)
* [Install from directly download](https://nodejs.org/en/download/)

Please install the latest LTS version on the list above.

Then verify the result:
Check before going next:

$ node -v
$ npm -v

# Installation

Choose one of the following ways to install leetcode-cli:
There are different ways to install `leetcode-cli`:

### From npm

This will install the latest stable version, but not include the latest development version.
This will install the latest STABLE version, but not include the latest DEV version.

$ npm install -g leetcode-cli
$ leetcode version

In case Ubuntu failed due to `permission denied`, run following and try again:
In case Ubuntu failed due to **permission denied**, try following:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
$ source ~/.bashrc
$ nvm install --lts

See more details [here](https://docs.npmjs.com/getting-started/fixing-npm-permissions).
Find more details [here](https://docs.npmjs.com/getting-started/fixing-npm-permissions).

### From GitHub

This will install the latest development version on GitHub.
This will install the latest DEV version from GitHub repo.

$ npm install -g skygragon/leetcode-cli
$ leetcode version

### From local source
### From source

Similar with above, while you can introduce your own changes as you wish.

$ git clone http://github.com/skygragon/leetcode-cli
$ cd leetcode-cli && ./bin/install
$ leetcode version

### From docker

Then verify the result:
NOTE: This is just a tiny taste to let you feel that leetcode-cli is. Please use other ways above to install leetcode-cli if you like it.

$ alias leetcode='docker run -it --rm skygragon/leetcode-cli'
$ leetcode version

To persistent user data, you can mount a folder like this:

$ alias leetcode='docker run -it --rm -v /Users/skygragon/data:/root skygragon/leetcode-cli'

0 comments on commit 7ed01d8

Please sign in to comment.