diff --git a/00 Introduction.md b/00 Introduction.md index bf8b306..d6719e8 100644 --- a/00 Introduction.md +++ b/00 Introduction.md @@ -103,4 +103,15 @@ There are plenty of choices when it comes to editors. The examples in this book Note that you may need to update the configuration database before Visual Studio Code will install. ``` sudo apt-get update && sudo apt-get install libgconf2-4 -``` \ No newline at end of file +``` + +### Launching a code editor from the Terminal + +You will be spending a lot of time in the terminal so here is a useful tip. If you have visual studio code installed you can launch it with the contents of a specified directory. Start by editing your `.bash_profile` file located in your home directory. Since this is hidden by default you can open it in **nano** using `nano ~/.bash_profile`. Now add the following line, save the changes and exit. +``` +code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;} +``` +Close the terminal and re-launch. Now you can open any directory. + +- `code ~/Documents/bookshop/` opens Visual Studio Code with the contents of the directory specified. +- `code .` opens Visual Studio Code with the contents of the _current directory_. diff --git a/04 Writing Robust Code.md b/04 Writing Robust Code.md index 10c0e36..aca6508 100644 --- a/04 Writing Robust Code.md +++ b/04 Writing Robust Code.md @@ -434,9 +434,9 @@ You should also add standard JavaScript comments to explain the code itself. The JSDoc is available as a NodeJS plugin. It has already been added as a _Dev Dependency_ in the `package.json` file and so it should already be installed. Lets use it to build the documentation for our modules. ``` -node_modules/.bin/jsdoc modules/ +ode_modules/.bin/jsdoc -d docs/jsdoc/ modules/ ``` -This will create an `out/` directory containing the complete documentation as a website. +This will create a `docs/jsdoc/` directory containing the complete documentation as a website. ``` . ├── fonts