Skip to content

Commit

Permalink
Simply compiling and running web server into devevelopment.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Tilley committed Feb 2, 2013
1 parent 63f9684 commit 37087d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
9 changes: 4 additions & 5 deletions README.md
Expand Up @@ -10,15 +10,14 @@ Running

1. Ensure you have [Node.js](http://nodejs.org) installed
2. Install the package dependencies: `npm install`
3. In a console window, start the CoffeeScript compilation: `./scripts/build.sh`
4. In another console window, start the built-in HTTP server: `./scripts/web-server.js`
5. Open `http://localhost:8000/index.html` in your browser
3. Start development mode by running: `./scripts/development.sh`
4. Open `http://localhost:8000/index.html` in your browser

`scripts/build.sh` watches the CoffeeScript files in `app/coffee` and compiles them to JavaScript in `app/js`; `app/index.html` includes these compiled JavaScript files to run the application. If you change a `.coffee` file in `app/coffee`, you must have `./scripts/build.sh` running so that the file gets recompiled.
`scripts/compile.sh` watches the CoffeeScript files in `app/coffee` and compiles them to JavaScript in `app/js`; `app/index.html` includes these compiled JavaScript files to run the application. If you change a `.coffee` file in `app/coffee`, be sure development mode is running so it will recompile the CoffeeScript.

Editing
-------

`app/coffee` contains all the CoffeeScript source for the application. The gem filter itself is defined in `services.coffee`. `app.coffee` defines the routes for the application, and `partials/main.htm` contains the view for the `IndexController` route (the main part of the app).

Don't forget to have `./scripts/build.sh` running to compile the CoffeeScript to JavaScript as you make changes.
Don't forget to have `./scripts/development.sh` running to compile the CoffeeScript to JavaScript as you make changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions scripts/development.sh
@@ -0,0 +1,11 @@
#!/bin/bash

# Arbitrary shell commands, some run in background
./scripts/compile.sh &
node ./scripts/web-server.js

# The magic line
# $$ holds the PID for this script
# Negation means kill by process group id instead of PID
trap "kill -TERM -$$" SIGINT
wait

0 comments on commit 37087d5

Please sign in to comment.